max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
eval-ccs2019/benchmark.py | nibau/zkay | 0 | 12795051 | <reponame>nibau/zkay<gh_stars>0
#!/usr/bin/env python3
# usage ./benchmark.py [example_dir]
# (example_dir contains subdirectories with example sol/zkay and scenario files)
# requires installed memory-profiler and zkay packages
import os
import datetime
import sys
import shutil
clean=False
file_dir = os.path.realpath... | 1.96875 | 2 |
src/models/ffhq_1024_haar/__init__.py | YorkUCVIL/Wavelet-Flow | 59 | 12795052 | from models.ffhq_1024_haar.Training_data import *
from models.ffhq_1024_haar.Validation_data import *
from models.ffhq_1024_haar.Network_body import *
from models.ffhq_1024_haar.Conditioning_network import *
import models.shared.routines as routines
from models.ffhq_1024_haar.build_training_graph import *
model_config... | 1.1875 | 1 |
mkAD/modify_init.py | arielthomas1/SHEMAT-Suite-Open | 0 | 12795053 | <filename>mkAD/modify_init.py<gh_stars>0
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import sys
import os
import re
def contains(theString, theQueryValue):
return theString.find(theQueryValue) > -1
targetfile = sys.argv[1]
if os.path.exists(os.getcwd() + "/" + targetfile):
openFile = open(targetfile)
wri... | 3.140625 | 3 |
Lib/xml/dom/minitraversal.py | M-Spencer-94/configNOW | 3 | 12795054 | """A DOM implementation that offers traversal and ranges on top of
minidom, using the 4DOM traversal implementation."""
import minidom, string
class DOMImplementation(minidom.DOMImplementation):
def hasFeature(self, feature, version):
if version not in ("1.0", "2.0"):
return 0
feature ... | 2.78125 | 3 |
module/reTestIP.py | yangliangguang/CrawlFreeProxy | 8 | 12795055 | import redis
from tools.common import test_http_proxy
import threading
def http_task():
# 连接redis数据库
POOL = redis.ConnectionPool(host='127.0.0.1', port=6379)
CONN_REDIS = redis.Redis(connection_pool=POOL)
# 取出一个ip进行测试
# proxy = CONN_REDIS.("freeProxy:AfterVerifyOKhttp")
ip = CONN_REDIS.srandme... | 2.875 | 3 |
draw_lines.py | ounessy/tabular-horizontal-line-drawing | 0 | 12795056 | import pytesseract
from pytesseract import Output
import cv2
import os
from shapely.geometry import Polygon
pytesseract.pytesseract.tesseract_cmd = "Tesseract path e.g c:\Tesseract-OCR\tesseract "
import sys
from os import chdir, listdir
from os.path import join
## Hyper Params
L = 'abcdefghijklmno... | 2.859375 | 3 |
danceschool/private_lessons/models.py | django-danceschool/django-danceschool | 32 | 12795057 | from django.db import models
from django.db.models import Q
from django.utils.translation import gettext_lazy as _
from django.utils import timezone
from django.urls import reverse
from datetime import timedelta
from danceschool.core.models import (
Instructor, Location, Room, DanceRole, Event, PricingTier,
E... | 2.03125 | 2 |
src/preprocess/modify_txts.py | Jeevesh8/relational-pt | 0 | 12795058 | for filename in ["test", "train", "valid"]:
with open("subtrees-text-4096/" + filename + ".txt") as f, open(
"subtrees-text-4096-64-comps/" + filename + ".txt", "w+") as g:
for line in f.readlines():
if line.count("<post") <= 64:
g.write(line)
| 2.4375 | 2 |
pyinsar/processing/deformation/__init__.py | MITeaps/pyinsar | 8 | 12795059 | <filename>pyinsar/processing/deformation/__init__.py
__all__ = ["elastic_halfspace", "inversion"] | 0.972656 | 1 |
Code/passiveRandomLearners.py | prajwalppv/Active-Learning-Uncertainity-sampling | 2 | 12795060 | <gh_stars>1-10
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.svm import LinearSVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes import GaussianNB
import matplotlib.patches as mpatches
import random
def compute_loss(model,testDat... | 2.96875 | 3 |
poppurri/currency/tests/test_templatetags.py | ariel17/poppurri | 0 | 12795061 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description: Templatetags test units.
"""
__author__ = "<NAME> (<EMAIL>)"
from decimal import Decimal
from django.test import TestCase
from currency.models import Currency
from currency.templatetags.to_currency import to_currency
class ToCurrencyTestCase(TestCase... | 2.78125 | 3 |
src/metrics/psnr_metric.py | ryanwongsa/image-inpainting | 0 | 12795062 | <reponame>ryanwongsa/image-inpainting
from ignite.metrics import Metric
from ignite.exceptions import NotComputableError
# These decorators helps with distributed settings
from ignite.metrics.metric import sync_all_reduce, reinit__is_reduced
import torch
import torch.nn as nn
from math import log10
class PSNR_Metric(... | 2.25 | 2 |
atoms_simulator/bin/__init__.py | Jorewin/atoms_simulator | 0 | 12795063 | import math
import click
import os.path
import shutil
import atoms_simulator
import numpy
import matplotlib.pyplot as plt
def get_project_path():
return os.path.dirname(atoms_simulator.__file__)
def get_path(path):
i = 1
while True:
if not os.path.lexists(f"{path}{i}"):
return f"{pat... | 2.75 | 3 |
Workshop2/6.py | Camiloasc1/OptimizationUNAL | 0 | 12795064 | import numpy as np
from scipy.optimize import linprog
c = [10, 3.8, 1.5]
A_ub = [
[1, 1, 1],
[-1, -1, -1],
[-1, -1. / 3., -1. / 6.]]
b_ub = [18, -12, -9]
res = linprog(c, A_ub=A_ub, b_ub=b_ub)
print(res)
| 2.484375 | 2 |
src/data_management/cleaning.py | timmens/tsa | 2 | 12795065 | <gh_stars>1-10
from pathlib import Path
import numpy as np
import pandas as pd
import pyarrow.parquet as pq
from bld.project_paths import project_paths_join as ppj
from src.shared import to_parquet_in_date_chunks
UNNECESSARY_COLUMNS = ["formatted_date", "geo"]
def load_data():
paths = list(Path(ppj("IN_DATA", ... | 2.328125 | 2 |
depoco/plot_results.py | shengxihua/deep-point-map-compression | 59 | 12795066 | <filename>depoco/plot_results.py<gh_stars>10-100
import numpy as np
import matplotlib.pyplot as plt
import glob
import argparse
from ruamel import yaml
import depoco.utils.point_cloud_utils as pcu
def plotResults(files, x_key, y_key, ax, draw_line=False, label=None, set_lim=True):
x = []
y = []
for f in fi... | 2.328125 | 2 |
code_prefixes/warp2code-prefixes.py | ipsilon/eof | 0 | 12795067 | #!/usr/bin/env python
# Processes OpenEthereum warp snapshot and collects 4-byte code prefixes of all accounts.
#
# openethereum --chain=kovan snapshot --snapshot-threads=8 snapshot.warp
# warp2code-prefixes.py snapshot.warp
import sys
import rlp
import snappy
import collections
prefix_map = collections.defaul... | 2.171875 | 2 |
worker.py | lordmauve/python-now | 1 | 12795068 | """Web Worker script."""
# In web workers, "window" is replaced by "self".
from browser import bind, self
import contextlib
import traceback
class OutputWriter:
def __init__(self, id, window):
self.id = id
self.window = window
self.buf = []
def write(self, text):
"""Write out... | 2.734375 | 3 |
NitroFE/time_based_features/indicator_features/_MovingAverageConvergenceDivergence.py | NITRO-AI/NitroFE | 81 | 12795069 | import numpy as np
import pandas as pd
from typing import Union, Callable
from pandas.core.frame import DataFrame
from NitroFE.time_based_features.indicator_features._AbsolutePriceOscillator import (
AbsolutePriceOscillator,
)
from NitroFE.time_based_features.moving_average_features.moving_average_features... | 2.765625 | 3 |
src/datamodules/archery_bowling_datamodule.py | V1ct0reo/lightning-fast-hydra | 0 | 12795070 | from pathlib import Path
from typing import Union, List, Dict, Optional
import pandas as pd
from torch.utils.data import DataLoader
import pytorch_lightning as pl
from torchvision.transforms import transforms
from src.utils.utils import get_logger
class ArcheryBowlingDataModule(pl.LightningDataModule):
def __i... | 2.40625 | 2 |
commander.py | MauTrib/gnn-en-folie | 0 | 12795071 | <gh_stars>0
import yaml
import toolbox.utils as utils
import os
from models import get_pipeline, get_pl_model, get_torch_model, get_optim_args, is_dummy
from models.base_model import GNN_Abstract_Base_Class
from data import get_test_dataset, get_train_val_datasets
from metrics import setup_metric
import pytorch_lightn... | 2.03125 | 2 |
bulk_import_rename/main.py | williamjamir/bulk-import-rename | 0 | 12795072 | import sys
import click
from bulk_import_rename.commands.detect_modifications import track_modifications
from bulk_import_rename.commands.rename_import import run_rename
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group(context_settings=CONTEXT_SETTINGS)
@click.version_option(vers... | 2.390625 | 2 |
census_data/core/variables.py | cj-on-campus/dabp-summer-reading | 0 | 12795073 | <filename>census_data/core/variables.py<gh_stars>0
import censusdata
import requests
import pandas as pd
census_key = '' # scrubbed for now, TODO: secrets config
def get_counties(state, year):
counties = []
geo = censusdata.geographies(censusdata.censusgeo([('state', state), ('county', '*')]), 'acs5', year)
... | 3.0625 | 3 |
server/module_stats.py | codingismycraft/pinta | 0 | 12795074 | <filename>server/module_stats.py
"""Exposes a class that holds change statistics for all modules.
Using the git log we are creating a history of changes for each module
and also append to it the number of target dependencies.
"""
import csv
import change_history
import settings
import targets
# Aliases.
settings = ... | 2.40625 | 2 |
colaboradores/urls.py | SurielRuano/Orientador-Legal | 0 | 12795075 | from django.conf.urls import url, include
from django.conf import settings
from . import views
urlpatterns = [
url(r'^solicitud-colaboracion/$', views.Solicitud_colaboracion.as_view(),name="solicitud"),
] | 1.4375 | 1 |
app/views.py | julesc00/travel-agency | 0 | 12795076 | <reponame>julesc00/travel-agency
from django.shortcuts import render
# Create your views here.
def index(request):
context = {
"moto": "The framework for perfectionist!"
}
return render(request, "app/index.html", context)
| 1.789063 | 2 |
main.py | dark7py/da | 0 | 12795077 | <filename>main.py
import pandas as pd
def non_matches(firs_param, second_param, data):
count = 0
for (f1, f2) in zip(data[firs_param], data[second_param]):
if not is_contains(f1, f2) and not is_contains(f2, f1):
count += 1
return count
def is_contains(first_field, second_field):
f... | 3.484375 | 3 |
PYTHON_LESSON/05-class_fifth.py | sly1314sly/selenium_basic | 1 | 12795078 | <gh_stars>1-10
#多继承
# class father1():
# def have(self):
# print("父级有的东西")
# class father2():
# def money(self):
# print("父级有的东西2")
# class son(father1,father2):
# pass
# john = son() #两个父级都调用
#如果两个父级有同样的东西,调用的是第一个里面的,优先继承第一个类
# class father1():
# ... | 3.96875 | 4 |
get_address.py | trentlo/btc-utils | 0 | 12795079 | <gh_stars>0
import sys
from getopt import getopt
from crypto.key import PublicKey, PrivateKey
if __name__ == '__main__':
# Always use the compressed form now.
compressed = True
net = "main"
mnemonic = None
num_hash = 3
argv = sys.argv[1:]
try:
# -n (net)
# `-d mnemonic`: deterministic key gen u... | 2.546875 | 3 |
AttackMethods/AttackMethod.py | Valentijn1995/Kn0ckKn0ck | 0 | 12795080 | import thread
import threading
import abc
from time import sleep
class AttackMethod:
"""
The AttackMethod class represents a DOS attack. The AttackMethod class is an abstract class and needs to be
extended by other classes. An AttackMethod runs in its own thread. The thread loop starts when the
... | 3.859375 | 4 |
alipay/aop/api/domain/SsdataDataserviceDatapropertyBatchqueryModel.py | antopen/alipay-sdk-python-all | 213 | 12795081 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class SsdataDataserviceDatapropertyBatchqueryModel(object):
def __init__(self):
self._action = None
self._action_param = None
self._base = None
self._data_channel = None... | 2.046875 | 2 |
app/gui/cryptotools/__init__.py | vasilypht/Cryptographic-methods | 0 | 12795082 | from typing import Final
from .freqanalysis import FreqAnalysisWidget
from .index_of_coincidence import ICWidget
from .autocorrelation import AutocorrelationWidget
from .kasiski import KasiskiWidget
WIDGETS_CRYPTOTOOLS: Final = (
FreqAnalysisWidget,
ICWidget,
AutocorrelationWidget,
KasiskiWidget
)
| 1.304688 | 1 |
utils/build_test_db.py | eternalconcert/robotframework-sqless | 0 | 12795083 | # This file is needed to initialize the models and migrations
import os
import sys
from nopea.dbobject import DbObject
from nopea import fields
from nopea.migrations import Migration
if 'sqlite' in sys.argv:
from nopea.adaptors.sqlite import SQLiteAdaptor
DbObject.adaptor = SQLiteAdaptor('sqless.db')
elif ... | 2.609375 | 3 |
mp/drawing/aoi_analysis.py | Ecotrust/COMPASS | 1 | 12795084 | <reponame>Ecotrust/COMPASS<filename>mp/drawing/aoi_analysis.py<gh_stars>1-10
from django.shortcuts import render
#from madrona.raster_stats.models import RasterDataset, zonal_stats
from settings import *
from general.utils import default_value, sq_meters_to_sq_miles
from drawing.models import *
'''
'''
def dis... | 2.234375 | 2 |
signaling-games/algs/model_agents/__init__.py | vbhatt-cs/inference-based-messaging | 3 | 12795085 | <reponame>vbhatt-cs/inference-based-messaging
from .model_s import ModelS
from .model_r import ModelR
__all__ = ["ModelR", "ModelS"]
| 0.996094 | 1 |
src/kgmk/dsa/misc/online_update_query/set_point_get_range/abstract/segtree/__init__.py | kagemeka/python | 0 | 12795086 | <gh_stars>0
from kgmk.dsa.algebra.abstract.structure.monoid import (
Monoid,
)
from \
kgmk.dsa.tree.misc.segment.normal.one_indexed.topdown \
.non_recursive \
import (
SegmentTree,
)
# TODO cut below
import typing
import typing
T = typing.TypeVar('T')
class SetPointGetRange(typing.Generic[T]):
def __i... | 2.28125 | 2 |
data/us-tn/co-knox/covid_age/harvester.py | mtna/covid-19 | 10 | 12795087 | import os
import math
import pandas as pd
import datetime
variables = [
'date_stamp',
'age_group',
'cnt_confirmed',
'pct_confirmed'
]
def cleanData(data, fileName):
# source data frame from csv file
source = pd.DataFrame(data)
source.columns = ['v1','v2','v3']
print(source)
# the target d... | 3.03125 | 3 |
example_algos/models/aes.py | MIC-DKFZ/mood | 42 | 12795088 | <gh_stars>10-100
import numpy as np
import torch
import torch.distributions as dist
from example_algos.models.nets import BasicEncoder, BasicGenerator
class VAE(torch.nn.Module):
def __init__(
self,
input_size,
z_dim=256,
fmap_sizes=(16, 64, 256, 1024),
to_1x1=True,
... | 2.40625 | 2 |
sme/test/test_parameter.py | henryiii/spatial-model-editor | 4 | 12795089 | <reponame>henryiii/spatial-model-editor<filename>sme/test/test_parameter.py
import unittest
import sme
class TestParameter(unittest.TestCase):
def test_parameter(self):
# get an existing parameter
m = sme.open_example_model()
p = m.parameters["param"]
# verify name and properties... | 2.953125 | 3 |
tests/conftest.py | YellowFlash2012/stock-portfolio-io | 0 | 12795090 | import pytest
import requests
from project import create_app, db
from flask import current_app
from project.models import Stock, User
from datetime import datetime
########################
#### Helper Classes ####
########################
class MockSuccessResponse(object):
def __init__(self, url):
self.s... | 2.453125 | 2 |
extractenronlib/extractenron.py | NitiBaghel/Enron-Dataset-Field-Extraction-Library | 0 | 12795091 | import email
import pandas as pd
def extract(data, structured_fields=[], extract_payload=True):
r"""This function extracts data for the given header list from the Enron email dataset.
It provides flexibilty to choose which fields needs to be extracted.
The header list provided by the user... | 3.875 | 4 |
python/adjacency_to_edgelist.py | conorfalvey/Python-MultilayerExtraction | 1 | 12795092 | <filename>python/adjacency_to_edgelist.py
# adjacency_to_edgelist
#
# Function that converts a list of adjacency matrices to an edgelist
# @param adjacency: a list whose ith entry is an adjacency matrix representing the ith layer of a multilayer network
# @future_param mode: directed or undirected
# @future_param weigh... | 3.546875 | 4 |
lab_3/lab_3_2.py | rybkinaliza/Python | 0 | 12795093 | #!/usr/bin/env python
# coding: utf-8
# In[13]:
import json
# In[18]:
def pluz(arg1, arg2):
try:
s = arg1 + arg2
except TypeError:
s = int(arg1) + int(arg2)
return s
# In[ ]:
| 3.1875 | 3 |
domonic/events.py | Jordan-Cottle/domonic | 1 | 12795094 | """
domonic.events
====================================
dom events
"""
# from typing import *
import time
# TODO - bring EventTarget here and get rid of this one?
class EventDispatcher(object):
""" EventDispatcher is a class you can extend to give your obj event dispatching abilities """
def __i... | 2.6875 | 3 |
load_dataset.py | AmanPriyanshu/Mapping-Temperature-using-DBNs | 0 | 12795095 | import pandas as pd
import numpy as np
import torch
def min_max_x(x):
for index, col in enumerate(x.T):
min_col = np.min(col)
max_col = np.max(col)
if min_col != max_col:
x.T[index] = (x.T[index] - min_col)/(max_col - min_col)
else:
x.T[index] = x.T[index] - min_col
return x
def load_dataset(path='./... | 2.59375 | 3 |
musictools/custom_exceptions.py | zfazli/zfmusicc | 49 | 12795096 | class SongNotFound(Exception):
def __init__(self, message, dErrorArg):
Exception.__init__(self, message, dErrorArg)
| 2.046875 | 2 |
tree_only.py | andrewli77/DISC | 7 | 12795097 | """
This code returns a DFA that is equivalent to the Tree constructed by compressing all the traces into one tree.
"""
import read_traces, DFA_utils_tree_only, time, tree_utils
def solve_tree_only(g_pos, G, Sigma, T, timeout, info, be_quiet=False):
assert g_pos in G, f"Error, g_pos not in G"
# creating the auxil... | 2.734375 | 3 |
reference/read_csv.py | SeanSyue/TensorflowReferences | 0 | 12795098 | # Source:
# https://www.tensorflow.org/api_guides/python/reading_data
import tensorflow as tf
# creates a FIFO queue for holding the filenames until the reader needs them.
# The following line is equivalent to :
# filename_queue = tf.train.string_input_producer(["file0.csv", "file1.csv"])
filename_queue = tf.tr... | 3.421875 | 3 |
mlapp/managers/pipeline_manager.py | kerenleibovich/mlapp | 33 | 12795099 | <reponame>kerenleibovich/mlapp<filename>mlapp/managers/pipeline_manager.py
import time
import datetime as dt
import importlib.util
import sys
import os
from mlapp.config import settings
from mlapp.utils.exceptions.base_exceptions import PipelineManagerException, FrameworkException
from mlapp.managers.io_manager import ... | 2.3125 | 2 |
ajax_datatable/templatetags/ajax_datatable_tags.py | ivi3/django-ajax-datatable | 101 | 12795100 | <gh_stars>100-1000
from django import template
register = template.Library()
################################################################################
# Support for generic editing in the front-end
@register.filter
def model_verbose_name(model):
"""
Sample usage:
{{model|model_name}}
"""
... | 2.328125 | 2 |
vang/pio/replace_in_zip.py | mattiasl/scripts | 6 | 12795101 | <filename>vang/pio/replace_in_zip.py<gh_stars>1-10
#!/usr/bin/env python3
from argparse import ArgumentParser
from difflib import ndiff
from sys import argv
from zipfile import ZipFile, ZIP_DEFLATED
def diff(name, content, updated_content):
diffs = list(ndiff(content.splitlines(1), updated_content.splitlines(1)))... | 3.078125 | 3 |
graphene/dijkstra.py | sushanttripathy/graphene | 0 | 12795102 | <filename>graphene/dijkstra.py
__author__ = 'Sushant'
from graph import Graph
import threading
from prioritydict import PriorityDict
class Dijkstra(Graph):
def __init__(self, num_threads=0, use_priority_queue=1):
super(Dijkstra, self).__init__()
self.shortest_paths = {}
self.shortest_path... | 3.125 | 3 |
i18nparse/__init__.py | nueh/i18nparse | 5 | 12795103 | <reponame>nueh/i18nparse<gh_stars>1-10
from .version import __version__
from .i18nparse import activate, deactivate
| 0.804688 | 1 |
Machine Learning/TensorflowExamples/simple_gradient_descent.py | sarojjethva/Learning-Resources | 639 | 12795104 | """
Author: <NAME>
Github: github.com/yashbmewada
Program for demonstrating simple line fitting using Tensorflow and Gradient Descent Algorithm
This program trains the model to fit two values, slope(m) and x-intercept(b) in the equation
of line y=mx+b. Here we would provide very small dataset of randomly generated po... | 4.09375 | 4 |
blog/views/post_view.py | ShahadatShuvo/blood_lagbe | 3 | 12795105 | <gh_stars>1-10
from django.shortcuts import render
def postView(request, id):
return render(request, 'blog/blog.html', context={}) | 1.5625 | 2 |
sandbox/static/robots.txt.py | vituocgia/wshop-core | 0 | 12795106 | <filename>sandbox/static/robots.txt.py
XXXXXXXXXXX X
XXXXXXXXX
| 1.039063 | 1 |
Python/AI-ToolBox/preprocess ToolBox/convert_tool/convert_txt2excel.py | Lornatang/DayHR | 7 | 12795107 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 17:20:22 2019
convert txt to excel
@author: zyb_as
"""
import os
import argparse, textwrap
import xlwt
# set options
parser = argparse.ArgumentParser(description = 'convert txt to excel',
usage = textwrap.dedent('''\
command example:
python %... | 3.484375 | 3 |
backend/schema.py | ReynaldoCC/arango-backend | 0 | 12795108 | <gh_stars>0
from abc import ABC
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor, ABC):
pass
| 1.484375 | 1 |
ex17.py | Eieiphyu/python_exercises | 0 | 12795109 | <gh_stars>0
from sys import argv
from os.path import exists
script, from_file, to_file = argv
print(f"Copy from {from_file} to {to_file}")
#2 on i line how
in_file = open(from_file)
indata = in_file.read()
print(f"Input file is {len(indata)} bytes long")
print(f"Doesoutput file exist? {exists(to_file)}")
print... | 3.015625 | 3 |
src/x2df/fileIOhandlers/fileIOhandler_parquet.py | mb-89/x2df | 0 | 12795110 | <gh_stars>0
from x2df.fileIOhandlers.__fileIOhandler__ import FileIOhandler
# we want to do the imports as late as possible to
# keep it snappy once we have more and more fileIOhandlers
class Handler(FileIOhandler):
def dump(self, df, dst, **kwargs):
# we import pyarrow here to make sure that is found by... | 2.390625 | 2 |
build.py | Dachaz/scenery | 9 | 12795111 | from pybuilder.core import init, use_plugin, Author
use_plugin('python.core')
use_plugin('python.flake8')
use_plugin('python.unittest')
use_plugin('python.coverage')
use_plugin('python.distutils')
use_plugin("python.install_dependencies")
authors = [Author('Dachaz', '<EMAIL>')]
license = 'MIT'
name = 'scenery'
summar... | 2.125 | 2 |
pygsti/objects/matrixforwardsim.py | drewrisinger/pyGSTi | 1 | 12795112 | <filename>pygsti/objects/matrixforwardsim.py<gh_stars>1-10
""" Defines the MatrixForwardSimulator calculator class"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under th... | 1.640625 | 2 |
tests/testing/test_check_data.py | Lambda-School-Labs/cryptolytic-ds | 13 | 12795113 | <filename>tests/testing/test_check_data.py
import cryptolytic.data.sql as sql
import cryptolytic.util as util
import cryptolytic.data.historical as h
def test_check_tables():
util.timeout(h.live_update, 10)
for api, exchange_id, trading_pair in h.yield_unique_pair():
df = (sql.get_some_candles
... | 2.28125 | 2 |
src/activity_notifications.py | yxtay/code-ex | 0 | 12795114 | <reponame>yxtay/code-ex
from collections import Counter
def activity_notifications(expenditure, d):
count = 0
counter = Counter(expenditure[:d])
for i in range(len(expenditure) - d):
median = compute_median(counter)
if expenditure[i + d] >= 2 * median:
count += 1
coun... | 2.71875 | 3 |
movies/utils2.py | Saifur43/Movie-Success-Prediction | 7 | 12795115 | <filename>movies/utils2.py
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from .models import Star, Director
def stars_update():
stars = Star.objects.all()
for star in stars:
if star.insta_followers == 0:
print(star.s_name)
url = star.st... | 3 | 3 |
epm/epm_logical_if.py | btc-ag/revengtools | 2 | 12795116 | <gh_stars>1-10
# -*- coding: UTF-8 -*-
'''
Created on 29.09.2010
@author: SIGIESEC
'''
from commons.core_if import EnumerationItem, Enumeration
class _LogicalEntityType(EnumerationItem):
pass
class LogicalEntityTypes(Enumeration):
Component = _LogicalEntityType
Interface = _LogicalEntityType
Configu... | 2.390625 | 2 |
tests/test_structures.py | UMDBPP/PacketRaven | 4 | 12795117 | from packetraven.packets.structures import DoublyLinkedList
def test_index():
list_1 = DoublyLinkedList([0, 5, 4, 'foo', 5, 6])
assert list_1[0] == 0
assert list_1[0] is list_1.head.value
assert list_1[3] == 'foo'
assert list_1[-2] == 5
assert list_1[-1] == 6
assert list_1[-1] is list_1.t... | 2.796875 | 3 |
tests/test_functions.py | rohankumardubey/griffe | 0 | 12795118 | """Test functions loading."""
import inspect
from griffe.loader import GriffeLoader
from tests import FIXTURES_DIR
loader = GriffeLoader()
def test_loading_functions_arguments(): # noqa: WPS218
"""Test functions arguments loading."""
module = loader.load_module(FIXTURES_DIR / "functions" / "arguments.py")... | 2.796875 | 3 |
EXAMPLES/DATA TYPES/String/password_generator.py | nkpydev/Python-Learning | 0 | 12795119 | <gh_stars>0
#--- Generic Imports ---#
import string
import random
from random import randint
if __name__ == '__main__':
characters = string.ascii_lowercase + string.ascii_uppercase + string.digits
password = ''.join(random.choice(characters) for x in range(randint(8,16)))
print('Password:\t',password) | 3.234375 | 3 |
python/specex_compute_sky.py | marcelo-alvarez/specex | 0 | 12795120 | #!/usr/bin/env python
import pyfits,sys,json,pylab,string,numpy,os,scipy,scipy.sparse,scipy.linalg
from scipy.sparse.linalg import spsolve
from math import *
from specex_cholesky import *
if len(sys.argv)<3 :
print sys.argv[0],"inspec.fits plPlugMapM.par outspec.fits (sky.fit)"
sys.exit(12);
infilename=sys... | 2.25 | 2 |
configmanager/base.py | haizaar/configmanager | 13 | 12795121 | <reponame>haizaar/configmanager<filename>configmanager/base.py
from .utils import not_set
class BaseItem(object):
is_item = True
is_section = False
is_config = False
def is_config_item(obj):
return isinstance(obj, BaseItem)
class BaseSection(object):
"""
A base class to allow detection of ... | 2.765625 | 3 |
forms.py | EricSekyere/Find-Mate | 0 | 12795122 | from flask_wtf import FlaskForm, RecaptchaField
from wtforms import StringField , PasswordField, SubmitField
from wtforms.validators import DataRequired, Email, Length
class SignupForm(FlaskForm):
firstname = StringField("First name", validators=[DataRequired("Enter your name")])
lastname = StringField("Last ... | 3.109375 | 3 |
before-2021/src/main/python/loadenv.py | wangyaomail/zzti-spark-learn | 1 | 12795123 | import sys
import os
from os.path import *
def pl():
return dirname(dirname(dirname(dirname(os.path.abspath(__file__)))))
class SparkEnv:
def __init__(self, name):
os.environ['HADOOP_HOME'] = dirname(dirname(dirname(dirname(os.path.abspath(__file__))))) + r'/hadoopdir'
os.environ['SPARK_HOME... | 2.5625 | 3 |
HackerRank/Python3/set_union.py | santoshgawande/DS-Algorithms | 0 | 12795124 | am = int(input())
a = set(map(int,input().split()))
bm = int(input())
b =set(map(int,input().split()))
print(len(a.union(b))) | 2.96875 | 3 |
EulerProject/0xx/00x/006/main.py | mathtimes/math-lab | 1 | 12795125 | <reponame>mathtimes/math-lab
i1 = i2 = 0
for i in range(1,101):
i1 += i
i2 += i**2
print(i1**2-i2) | 3.203125 | 3 |
app/core/module/chat_main.py | xiaomi2019/lolita_son | 0 | 12795126 | <gh_stars>0
# coding: utf-8
#
import app.base.game_module_mgr
from app.core.game_event_def import *
from app.protocol.ProtocolDesc import *
import app.protocol.netutil as netutil
from twisted.python import log
import app.util.helper as helper
import app.util.lang_config as lang_config
import app.chat.memmode as memmod... | 1.859375 | 2 |
predict.py | binh234/capu | 0 | 12795127 | <reponame>binh234/capu<filename>predict.py
import argparse
from utils.helpers import read_lines
from gector.gec_model import GecBERTModel
from tqdm import tqdm
import re
def predict_for_file(
input_file,
output_file,
model,
batch_size=32,
split_chunk=False,
chunk_size=32,
overlap_si... | 2.34375 | 2 |
admin/client.py | stackriot/flocker | 2,690 | 12795128 | # Copyright 2015 ClusterHQ Inc. See LICENSE file for details.
"""
Run the client installation tests.
"""
import os
import shutil
import sys
import tempfile
from characteristic import attributes
import docker
from effect import TypeDispatcher, sync_performer, perform
from twisted.python.usage import Options, UsageErr... | 1.929688 | 2 |
util/unit_test/bc_test/bc_normal_testing.py | ajupatatero/neurasim | 0 | 12795129 | <gh_stars>0
import numpy as np
from engines.phi.torch.flow import *
from numpy.core import shape_base
from scipy.signal.filter_design import _vratio
from util.plot.plot_tools import *
from analysis.mesure import *
from neurasim import *
from util.operations.field_operate import *
out_dir='./'
Nx=10
Ny=10
Ly=10
Lx=10... | 1.601563 | 2 |
shooting.py | hcbh96/SC_Coursework_1 | 2 | 12795130 | from scipy.optimize import root
from scipy.integrate import solve_ivp
import numpy as np
def phase_cond(u, dudt):
res= np.array(dudt(0,u))
return res
def periodicity_cond(u, dudt, T):
# integrate the ode for time t from starting position U
res = np.array(u - solve_ivp(dudt, (0, T), u).y[:,-1])
ret... | 2.78125 | 3 |
utils/deployment/link_cover.py | jstavr/SDN_Project | 0 | 12795131 | <reponame>jstavr/SDN_Project
#!/usr/bin/python
import networkx as nx
import time, random, copy
topology_file = open("data/topology.data")
G=nx.read_edgelist(topology_file)
topology_file.close()
#Only numbers are end terminals
end_terminals = [unicode(str(x)) for x in range(1, 100)]
links = G.edges()
shortest_paths =... | 2.5 | 2 |
agrirouter/onboarding/exceptions.py | DKE-Data/agrirouter-sdk-python | 0 | 12795132 | class AgriRouuterBaseException(Exception):
_message = ...
def __init__(self, message=None):
if not message:
message = self._message
self.message = message
class WrongCertificationType(AgriRouuterBaseException):
_message = "Wrong Certification type. Use onboarding.enums.Certifi... | 2.6875 | 3 |
unnoise/medianV1.py | Krown0s/TraitementsImages | 0 | 12795133 | <reponame>Krown0s/TraitementsImages<filename>unnoise/medianV1.py
# -*- encoding: utf-8 -*-
from copy import deepcopy
from numpy import *
"""
Débruitage par filtrage médian
<image> l'image à débruiter
retourne l'image débruitée
"""
def median(image):
nombrePixel = 0
newimg = deepcopy(image)
# Pa... | 2.984375 | 3 |
src/zope/pluggableauth/plugins/httpplugins.py | zopefoundation/zope.pluggableauth | 2 | 12795134 | <gh_stars>1-10
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribut... | 2.0625 | 2 |
cmscalibration/workflows/gridkacalibration.py | mxsg/CMS-Model-Calibration | 0 | 12795135 | import logging
import os
from datetime import datetime
import pandas as pd
from analysis import calibrationreport, resource_usage, cpuefficiency, sampling
from analysis import jobreportanalysis
from analysis import jobreportcleaning
from analysis import nodeanalysis
from analysis.demandextraction import FilteredJobCl... | 2 | 2 |
src/hello_world.py | DreamMazeTeam/BootSrc | 0 | 12795136 | <gh_stars>0
import module1
module1.hello() | 1.007813 | 1 |
django/wx/apps.py | yanhuaijun/learngit | 2 | 12795137 | from django.apps import AppConfig
class WxConfig(AppConfig):
name = 'wx'
| 1.210938 | 1 |
02_P12.py | wiphoo/computer_programing_101 | 0 | 12795138 | #!/usr/bin/env python3
inputList = input()
abcList = sorted( [ int( x ) for x in inputList.split() ] )
print( 'abcList = {}'.format( abcList ) )
print( 'YES' if abcList[0] + abcList[1] > abcList[2] else 'NO' )
| 3.875 | 4 |
scripts/AQP_byPath/collect_results.py | TranslatorIIPrototypes/robo-commons | 1 | 12795139 | <reponame>TranslatorIIPrototypes/robo-commons<filename>scripts/AQP_byPath/collect_results.py
from neo4j.v1 import GraphDatabase
import redis
import json
import os
import time
def get_hits(b_id,atype,edge_name,neo4j):
cypher = f'MATCH (a:{atype})-[:{edge_name}]-(b {{id:"{b_id}"}}) RETURN distinct a.id'
rlist = ... | 2.15625 | 2 |
cli/prog/cluster.py | rushk014/manager | 19 | 12795140 | <gh_stars>10-100
import click
from prog.cli import cli
from prog.cli import create
from prog.cli import delete
from prog.cli import request
from prog.cli import set
from prog.cli import unset
from prog.cli import show
from prog import client
from prog import output
from prog import utils
@show.group("cluster", invok... | 2.421875 | 2 |
scripts/searchbibs.py | acumb/SearchRefs | 0 | 12795141 | <reponame>acumb/SearchRefs<gh_stars>0
#!/usr/env python
"""Search bibliography database.
The search string takes the format of field:[field name] followed by a list of
terms to search for in that field. The implied boolean operator between these
terms is "and". To use other boolean operators with the same field, the
... | 3.546875 | 4 |
integration/tests/integration/tests/smoke/instance.py | sapcc/trove | 1 | 12795142 |
from proboscis.asserts import assert_equal
from proboscis import test
from proboscis import before_class
from trove.common.utils import poll_until
from trove.tests.util import create_client
class InstanceGenerator(object):
def __init__(self, client, status=None, name=None, flavor=None,
account... | 2.53125 | 3 |
LC218.py | XinnWang/PythonLab | 0 | 12795143 | <gh_stars>0
buildings = [ [2,9,10], [3,7,15], [5,12,12], [15,20,10], [19,24,8] ]
#buildings = [[0,2,3],[2,5,3]]
s = []
for e in buildings:
s.append([e[0],e[2]])
s.append([e[1],-e[2]])
s = sorted(s,key=lambda x:(x[0],-x[1]))
print(s)
res = []
h = [0]
max_h = 0
for e in s:
if e[1] < 0:
h.remove(-e[1... | 2.875 | 3 |
Data Science and Machine Learning/Machine-Learning-In-Python-THOROUGH/EXAMPLES/EDABIT/EARLIER/23_sales_season.py | okara83/Becoming-a-Data-Scientist | 0 | 12795144 | """
Sales Season
A retailer is having a store-wide "buy 3, get 1 free" sale.
For legal reasons, they can't charge their customers $0 for an article so a discount is applied to all products instead.
For example, if a customer gets three products a, b and c:
Product A Product B Product C
$15.99 $23.50 $10.75
She gets ... | 4.15625 | 4 |
tests/test_load.py | yaniv-aknin/fafalytics | 1 | 12795145 | <filename>tests/test_load.py
import testutils
from fafalytics import loader
from fafalytics.pyutils import Query as Q
def test_load():
dump = testutils.testdata / 'dump.json'
with open(dump) as handle:
resolver = loader.GameJsonResolver.from_handle(handle)
games = {game['id']: game for game in... | 2.53125 | 3 |
manager.py | contrailnfx/Controller | 0 | 12795146 | <reponame>contrailnfx/Controller<filename>manager.py
import sys
import os
from orchestrator.app import app
from flask_sqlalchemy import SQLAlchemy
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager, Server
host = app.config['HOST']
db_url= app.config['SQLALCHEMY_DATABASE_URI']
... | 2.28125 | 2 |
src/graph_transpiler/webdnn/frontend/chainer/functions/noise.py | steerapi/webdnn | 1 | 12795147 | <gh_stars>1-10
import chainer
from webdnn.frontend.chainer.converter import ChainerConverter
from webdnn.util import console
@ChainerConverter.register_handler("Dropout")
def _convert_dropout(converter: ChainerConverter, c_op: "chainer.functions.Dropout"):
console.warning("[ChainerConverter] Dropout is ignored")... | 2.5 | 2 |
mini-projects/aic-15-image-search-engine/utils/utils.py | elbertsoftware/SpringboardAIC | 3 | 12795148 | <gh_stars>1-10
import numpy as np
from scipy.spatial.distance import hamming, cosine, euclidean
def compare_color(color_vectors,
uploaded_image_colors,
ids):
'''
Comparing color vectors of closest images from the training set with a color vector of a uploaded imag... | 2.90625 | 3 |
shell/lab0.py | utep-cs-systems-courses/os-shell-janguiano4 | 0 | 12795149 | #<NAME>
#CS4375: OS
#3 methods
from os import read #from os library import read method
next = 0
limit = 0
#This method calls read to fill a buffer, and gets one char at at time
def my_getChar(): #define = creating method : use method, loops, tryCatch
global next, limit #initializing 2 variables
if next == l... | 3.6875 | 4 |
app/__init__.py | sebbesiren/game-api | 0 | 12795150 | <reponame>sebbesiren/game-api
from eve import Eve
from app.domain import DOMAIN
from app.services import Services
from config import Config
def create_app():
app = Eve()
Services.init_services(app=app, domain=DOMAIN)
return app
| 1.609375 | 2 |