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
Source/YBio.py
YuriShporhun/YBio
0
12782751
<reponame>YuriShporhun/YBio from YSeq import YSeq from YLoader import YLoader from YDNA import YDNA from YRNA import YRNA class YSeqFunc: def __init__(self): pass @staticmethod def hamming_distance(seq_one, seq_two): """ En: A Static method which calculates the Hamming distance ...
2.953125
3
src/python/pyllars/cppparser/generation/clang/tranlation_unit.py
nak/pyllars
2
12782752
from pyllars.cppparser.parser.clang_translator import NodeType from .generator import Generator class TranslationUnitDeclGenerator(Generator): def generate(self): pass
1.359375
1
evaluation/interpolate_pc_codes.py
eduarddohr/pc2pix
12
12782753
<gh_stars>10-100 '''Render point clouds from test dataset using pc2pix python3 interpolate_pc_codes.py --ptcloud_ae_weights=../model_weights/ptcloud/chair-pt-cloud-stacked-ae-chamfer-5-ae-weights-32.h5 -p=32 -k=5 --generator=../model_weights/pc2pix/chair-gen-color.h5 --discriminator=../model_weights/pc2pix/chair-dis-c...
2.140625
2
webservice/funcs/ask_question.py
jordsti/hacker-jeopardy
6
12782754
<gh_stars>1-10 from ..service_func import service_func, func_error, meta_arg import random class ask_question(service_func): def __init__(self): service_func.__init__(self, '/question/ask') self.name = "Ask Question" self.description = "Ask a question to a team, with a category id and a ran...
2.78125
3
util/level_set/ls_util/interactive_ls.py
margaritiko/UGIR
46
12782755
<gh_stars>10-100 import time import os import GeodisTK import numpy as np import matplotlib.pyplot as plt import scipy.ndimage.filters as filters from PIL import Image from scipy import ndimage from skimage import measure from mpl_toolkits.mplot3d import Axes3D from level_set.ls_util.drlse_reion import * def show_leve...
1.992188
2
tests/asp/gringo/simplify.002.test.py
bernardocuteri/wasp
19
12782756
input = """ a :- b, not a. """ output = """ {} """
1.65625
2
msg/__init__.py
trym-inc/django-msg
7
12782757
default_app_config = 'msg.apps.MsgConfig'
1.210938
1
skyfield/projections.py
dieli/python-skyfield
0
12782758
<reponame>dieli/python-skyfield from numpy import sqrt from .functions import length_of def _derive_stereographic(): """Compute the formulae to cut-and-paste into the routine below.""" from sympy import symbols, atan2, acos, rot_axis1, rot_axis3, Matrix x_c, y_c, z_c, x, y, z = symbols('x_c y_c z_c x y z'...
3.46875
3
raynet/common/camera.py
paschalidoud/raynet
76
12782759
import numpy as np class Camera(object): """Camera is a simple finite pinhole camera defined by the matrices K, R and t. see "Multiple View Geometry in Computer Vision" by <NAME> and <NAME> for notation. Parameters ---------- K: The 3x3 intrinsic camera parameters R: The 3x3 rota...
3.6875
4
Examples/Suppliments/hello_unicode.py
Sharmila8/intropython2016
0
12782760
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- hello = 'Hello ' world = u'世界' print hello + world print u"It was nice weather today: it reached 80\u00B0" print u"Maybe it will reach 90\N{degree sign}" print u"It is extremely rare for it ever to reach 100° in Seattle"
2.421875
2
PyEngine3D/Utilities/Config.py
ubuntunux/PyEngine3D
121
12782761
<reponame>ubuntunux/PyEngine3D<gh_stars>100-1000 import os import configparser import traceback from . import Logger # util class class Empty: pass def evaluation(value): # find value type try: evalValue = eval(value) if type(evalValue) in [int, float, list, tuple, dict]: re...
2.4375
2
examples/load.py
KokaKiwi/ryaml
14
12782762
SRC = """ --- - - college - -380608299.3165369 - closely: 595052867 born: false stomach: true expression: true chosen: 34749965 somebody: false - positive - true - false - price - 2018186817 - average - young - -1447308110 """ import ryaml for _ in range(1000): ryaml.loads(SRC)
1.601563
2
mi/dataset/parser/parad_j_cspp.py
rmanoni/mi-dataset
1
12782763
<filename>mi/dataset/parser/parad_j_cspp.py """ @package mi.dataset.parser.parad_j_cspp @file marine-integrations/mi/dataset/parser/parad_j_cspp.py @author <NAME> @brief Parser for the parad_j_cspp dataset driver Release notes: initial release """ __author__ = '<NAME>' __license__ = 'Apache 2.0' import re import num...
1.796875
2
odoo-13.0/addons/website_slides_survey/models/slide_slide.py
VaibhavBhujade/Blockchain-ERP-interoperability
0
12782764
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class SlidePartnerRelation(models.Model): _inherit = 'slide.slide.partner' user_input_ids = fields.One2many('survey.user_input', 'slide_partner_id', 'Certification attempts...
2.125
2
pacote-download/Exercicios/Desafio100.py
lucasdmazon/CursoVideo_Python
0
12782765
from random import randint from time import sleep def sorteia(lst): print('Sorteando 5 valores da lista: ', end='') for i in range(0, 5): num = randint(1, 10) lst.append(num) print(num, end=' ') sleep(0.5) print('PRONTO!') def somaPar(lst): soma = 0 for i in lst: ...
3.6875
4
plugins/viewcam.py
komoto48g/wxpj
0
12782766
#! python # -*- coding: utf-8 -*- ## import time import wx import cv2 import numpy as np from mwx.controls import Param, LParam from mwx.controls import ToggleButton, Choice from mwx.graphman import Layer, Thread import editor as edi class Plugin(Layer): """Plugins of camera viewer """ menu = "Cameras" ...
2.1875
2
stib_administraciones/personales/models.py
nfheredia/stib-administraciones
0
12782767
<reponame>nfheredia/stib-administraciones<filename>stib_administraciones/personales/models.py<gh_stars>0 from django.db import models from ..core.models import TimeStampedModel class Personales(TimeStampedModel): """ Modelo para almacenar los diferentes tipos de personales que trabajan en un edificio. ...
2.0625
2
migrations/versions/57beb47d38d3_init.py
Bloodielie/trip_counter
0
12782768
<filename>migrations/versions/57beb47d38d3_init.py """init Revision ID: 57beb47d38d3 Revises: Create Date: 2021-12-02 18:11:42.551720 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '57<PASSWORD>4<PASSWORD>3' down_revision = None branch_labels = None depends_o...
1.789063
2
app/main/hs_api_log_forms.py
RRRoger/MyWebserver-flask
20
12782769
<filename>app/main/hs_api_log_forms.py from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, SelectField, PasswordField, IntegerField, TextAreaField, BooleanField from wtforms.validators import DataRequired, EqualTo, Length class HsApiLogSearch(FlaskForm): methods = [ ('url', 'URL'...
2.578125
3
django_project/weatherapp/settings_dev.py
bbsoft0/weather
1
12782770
<filename>django_project/weatherapp/settings_dev.py """local runserver settings""" import os from .settings import BASE_DIR # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = "<KEY>" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Da...
2
2
psana/psana/detector/test_xx_ipython.py
ZhenghengLi/lcls2
16
12782771
def test_ipython(): print('DATA FILE IS AVAILABLE ON drp-ued-cmp001 ONLY') #from psana.pyalgos.generic.NDArrUtils import info_ndarr from psana import DataSource ds = DataSource(files='/u2/pcds/pds/ued/ueddaq02/xtc/ueddaq02-r0028-s000-c000.xtc2') run = next(ds.runs()) det = run.Detector('epix...
2.15625
2
validate_infrastruture.py
dell-ai-engineering/BigDL4CDSW
2
12782772
import os import os.path from IPython.display import display, HTML def html_log(message,tag="H1", color="black",center=False): if center: display(HTML('<{tag}> <center> <font color="{color}"> {message}</font></center></{tag}>'.format(tag=tag, message=message,color=color))) else: display(HTML('<...
2.609375
3
Python/NeonOcean.S4.Main/NeonOcean/S4/Main/Director.py
NeonOcean/Main
1
12782773
from __future__ import annotations import typing import clock import zone from NeonOcean.S4.Main import Mods, This from NeonOcean.S4.Main.Tools import Exceptions from protocolbuffers import FileSerialization_pb2 from server import client as clientModule from sims4 import service_manager from sims4.tuning import insta...
2.09375
2
preprocess_scripts/group.py
ictnlp/STEMM
11
12782774
<gh_stars>10-100 import os import shutil import argparse parser = argparse.ArgumentParser() parser.add_argument("--lang", help="target language") args = parser.parse_args() splits = ['dev', 'tst-COMMON', 'tst-HE', 'train'] root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) seg_path = os.path.join(root...
2.421875
2
1556_thousand_separator.py
claytonjwong/leetcode-py
1
12782775
# # 1556. Thousand Separator # # Q: https://leetcode.com/problems/thousand-separator/ # A: https://leetcode.com/problems/thousand-separator/discuss/805674/Javascript-Python3-C%2B%2B-1-Liners # class Solution: def thousandSeparator(self, n: int) -> str: return str(n) if n < 1000 else self.thousandSeparator(...
3.203125
3
rest_models/backend/utils.py
matheusmatos/django-rest-models
61
12782776
<reponame>matheusmatos/django-rest-models<gh_stars>10-100 # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import logging logger = logging.getLogger(__name__) def message_from_response(response): return "[%d]%s" % ( response.status_code, response.t...
2.078125
2
main.py
keygen-sh/example-python-activation-proof-verification
2
12782777
<reponame>keygen-sh/example-python-activation-proof-verification from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.backends import default_backend from cryptography.exceptions import InvalidSignature import base64 impo...
3.078125
3
tests/models.py
ckirby/django-model-ident
2
12782778
from django.db import models class BaseManagerModel(models.Model): @classmethod def create(cls): return cls.objects.create() class TestManager(models.Manager): def get_queryset(self): return super(TestManager, self).get_queryset().none() class RenameManagerModel(models.Model): inst...
2.21875
2
Poisson_S1_hypersphere.py
zhang-liu-official/project3-pinn-test
0
12782779
<filename>Poisson_S1_hypersphere.py """Backend supported: tensorflow.compat.v1""" import deepxde as dde import xde as xde import numpy as np import matplotlib import matplotlib.pyplot as plt import random from deepxde.backend import tf ## useful reference: https://en.wikipedia.org/wiki/Laplace_operator#Coordinate_expr...
2.734375
3
invest/tests/test_template_tags.py
uktrade/invest
1
12782780
<filename>invest/tests/test_template_tags.py<gh_stars>1-10 from unittest.mock import call, Mock, patch import pytest from invest.templatetags.language_tags import change_lang_with_querystring @pytest.mark.parametrize( 'change_lang_response,expected_response', [ ('', ''), ('foo?bar=hello', 'f...
2.578125
3
tensorflow/stream_executor/cl/test/test_random.py
salvatoretrimarchi/tf-coriander
0
12782781
from __future__ import print_function import tensorflow as tf import numpy as np import pytest import sys from tensorflow.python.ops import array_ops shapes = [ (3, 4), (50, 70, 12) ] seed = 123 def _test_random_func(func_name, shape): print('func_name', func_name) func = eval(func_name) with t...
2.234375
2
gpycharts.py
diotrahenriyan/goopycharts
0
12782782
<reponame>diotrahenriyan/goopycharts # To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% [markdown] # # Creating Graphs with Python and GooPyCharts # Source: [datascience+](https://datascienceplus.com/creating-graphs-with-python-and-goopycharts/) # %% [markdown] # ## Install gpcha...
3.15625
3
django_sendgrid_tracking/signals.py
MattFanto/django-sendgrid-tracking
5
12782783
from sendgrid_backend.signals import sendgrid_email_sent from django_sendgrid_tracking.mail import create_send_email sendgrid_email_sent.connect(create_send_email)
1.21875
1
nugridpy/regression_tests/ImageCompare/compare_image_entropy.py
NuGrid/NuGridPy
16
12782784
<gh_stars>10-100 from __future__ import print_function from __future__ import division from builtins import range from past.utils import old_div import matplotlib.image as mpimg import matplotlib.pylab as plb import numpy import sys from scipy import stats import glob import os.path import warnings import time def com...
2.3125
2
30_days_leetcode_challenge/MinStack.py
Imipenem/Competitive_Prog_with_Python
0
12782785
class MinStack: def __init__(self): """ initialize your data structure here. """ self.min = [] self.stack = [] def push(self, x: int) -> None: self.stack.insert(0, x) if not self.min or x <= self.min[-1]: # only those <= to actual min must be taken into...
4.03125
4
contests/kickstart-2021H/p1.py
forewing/lc
0
12782786
def solve(s, f): dist = [100] * 26 avaliable = set(map(lambda c: ord(c) - ord('a'), f)) for i in range(26): if i in avaliable: dist[i] = 0 else: for a in avaliable: dist[i] = min(dist[i], abs(a-i), 26-abs(a-i)) ans = 0 for c in s: ans +...
2.921875
3
exercises/en/exc_08_04a.py
Lavendulaa/programming-in-python-for-data-science
1
12782787
<reponame>Lavendulaa/programming-in-python-for-data-science import numpy as np # Create 2 lists containing any the same number of elements # Save each as objects named a_list and b_list ____ ____ # Using boolean operators, what is outputted when you test to see if they are equal? ____
3.90625
4
getDailyBhav.py
krthkj/pythonDumps
0
12782788
#!/usr/bin/python import zipfile # read, test zipfile import os, errno # delete file and handle error import urllib2 # download file import datetime # date and time object # deletes the file def silentRemove(filename): try: os.remove(filename) print filename + " removed" except OSError as e: if e.errno != err...
3.265625
3
aquascope/data_processing/export.py
MicroscopeIT/aquascope_backend
0
12782789
import os import tempfile from aquascope.webserver.data_access.conversions import list_of_item_dicts_to_tsv from aquascope.webserver.data_access.storage.export import upload_export_file def export_items(items, storage_client): with tempfile.TemporaryDirectory() as tmpdirname: local_filepath = os.path.joi...
2.28125
2
retiolum/scripts/adv_graphgen/tinc_graphs/BackwardsReader.py
makefu/painload
9
12782790
import sys import os import string class BackwardsReader: """ Stripped and stolen from : http://code.activestate.com/recipes/120686-read-a-text-file-backwards/ """ def readline(self): while len(self.data) == 1 and ((self.blkcount * self.blksize) < self.size): self.blkcount = self.blkcount + 1 line ...
2.921875
3
Desafios/desafio045.py
LucasHenrique-dev/Exercicios-Python
1
12782791
from random import choice from time import sleep print('Vamos jogar \033[32mJokenpô\033[m') escolhas = ['pedra', 'papel', 'tesoura'] computador = choice(escolhas) jogador = str(input('Já escolhi a minha opção, qual a sua jogador \033[34mdesafiante\033[m: ')).strip().lower() while not (jogador in escolhas): jogador...
3.71875
4
qftimports.py
Bra-A-Ket/QFTools
1
12782792
#!/usr/bin/env python3 # external packages import os import getopt import sys from time import time import itertools as it import csv from collections import Counter import numpy as np # internal imports from qftoolslib.wick import *
1.109375
1
python/gdal_cookbook/cookbook_geometry/calculate_in_geometry.py
zeroam/TIL
0
12782793
<filename>python/gdal_cookbook/cookbook_geometry/calculate_in_geometry.py from osgeo import ogr """ Calculate Envelope of a Geometry """ wkt = "LINESTRING (1181866.263593049 615654.4222507705, 1205917.1207499576 623979.7189589312, 1227192.8790041457 643405.4112779726, 1224880.2965852122 665143.6860159477)" geom = og...
2.875
3
src/opts.py
xdr940/som-TSP
0
12782794
<gh_stars>0 import argparse class OPT: def __init__(self): self.parser = argparse.ArgumentParser(description='M2CT2020') # ------------------------------- self.parser.add_argument('--wk_root', type=str, default='/home/roit/aws/aprojects/M2CT2020/proj') self.parser.add_argument('--d...
2.4375
2
qualifiedname/qname_inspect.py
maxfischer2781/qualifiedname
0
12782795
from __future__ import print_function import inspect import ast import sys import collections import weakref def qualname(obj): """ Lookup or compute the ``__qualname__`` of ``obj`` :param obj: class or function to lookup :return: ``__qualname__`` of ``obj`` :rtype: str :raises: AttributeErro...
2.640625
3
qatm.py
gyhdtc/QATM_pytorch
0
12782796
<reponame>gyhdtc/QATM_pytorch<filename>qatm.py from pathlib import Path import torch import torchvision from torchvision import models, transforms, utils import argparse import multiprocessing import pyrealsense2 as rs from ctypes import c_wchar_p import numpy as np import cv2 # + # import functions and classes from q...
2.21875
2
examples/single_tbst_database.py
shunsvineyard/forest-python
8
12782797
"""The module demonstrates using threaded binary trees to implement ordered index.""" from typing import Any from forest.binary_trees import single_threaded_binary_trees from forest.binary_trees import traversal class MyDatabase: """Example using threaded binary trees to build index.""" def __init__(self) ...
3.75
4
App/backend/app/serial/events.py
UWO-Aero-Design/gnd-station
4
12782798
<reponame>UWO-Aero-Design/gnd-station #Websocket from flask import session,jsonify from flask_socketio import emit,send from .. import socketio import time import random from app import database from app.database import databasehelperclass,queryDatabase from .. import dbase from .. import serialDataOut from .. import...
2.703125
3
scripts/build_sdk_ios.py
kokorinosoba/xamarin_sdk
10
12782799
from scripting_utils import * def build(version, root_dir, ios_submodule_dir, with_test_lib): # ------------------------------------------------------------------ # paths srcdir = '{0}/sdk'.format(ios_submodule_dir) lib_out_dir = '{0}/ios/AdjustSdk.Xamarin.iOS/Resources'.fo...
1.773438
2
19 - Drawing Live Graphs.py
mayankdcoder/Matplotlib
1
12782800
<filename>19 - Drawing Live Graphs.py # Drawing live graphs # If the data reservoir is getting updated regularly then use this for graphing in real time. import matplotlib.pyplot as plt import matplotlib.animation as animation import matplotlib.style as style style.use('fivethirtyeight') figure = plt.figure() axes1 ...
3.359375
3
opendc-web/opendc-web-api/opendc/api/traces.py
Timovanmilligen/opendc
32
12782801
<filename>opendc-web/opendc-web-api/opendc/api/traces.py # Copyright (c) 2021 AtLarge Research # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without lim...
1.875
2
functions_lib.py
surajpaib/CrowdEstimationchallenge
0
12782802
<gh_stars>0 import cv2 import numpy as np class CrowdCounter(object): def __init__(self): self.params = None def mutlifile_read(self, *args): for arg in args: yield cv2.imread(arg) def multifile_write(self, *args): for arg in args: cv2.imwrite(arg[0], arg[...
2.34375
2
label_process/code/label_preprocessing.py
tisssu10086/Gibbon_call_detection
0
12782803
import os import numpy as np import pandas as pd '''This script is for preprocessing the label, finding the mistake in it and stroe label in a unified format in processed_label dic''' file_dic_Extra = os.listdir('../../label/Extra_Labels') file_dic_Train = os.listdir('../../label/Train_labels') file_dic_Test = os.lis...
2.65625
3
measuredivergence/copyrandom.py
tedunderwood/measureperspective
4
12782804
import shutil, os, glob import pandas as pd for ratio in [0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100]: metafile = 'partitionmeta/meta' + str(ratio) + '.csv' df = pd.read_csv(metafile, index_col = 'docid') for i in df.index: if df.loc[i, 'tags'] != 'random': continue outpa...
2.140625
2
projects/cookie/platform/taobao/taobao_shop_goods.py
kingking888/crawler-pyspider
1
12782805
<reponame>kingking888/crawler-pyspider import json import random import time from cookie.model.data import Data as CookieData from cookie.config import * from crawl_taobao_goods_migrate.model.result import Result from crawl_taobao_goods_migrate.page.goods_details import GoodsDetails from pyspider.libs.webdriver import...
2.671875
3
ci/recipe/RecipeRepoReader.py
andrsd/civet
29
12782806
<gh_stars>10-100 #!/usr/bin/env python # Copyright 2016 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
2.421875
2
ProteinGraphML/MLTools/MetapathFeatures/featureBuilder.py
JessBinder/ProteinGraphML
10
12782807
<reponame>JessBinder/ProteinGraphML import os,re import itertools import logging import pandas as pd from .nodes import ProteinInteractionNode def getMetapaths(proteinGraph,start): children = getChildren(proteinGraph.graph,start) if start in proteinGraph.childParentDict.keys(): # if we've got parents, lets remo...
2.6875
3
scripts/convert_to_frames.py
TechieBoy/deepfake-detection
0
12782808
import os import cv2 from concurrent.futures import ProcessPoolExecutor import torch from facenet_pytorch import MTCNN from tqdm import tqdm from PIL import Image import pickle from face_detection import RetinaFace from bisect import bisect_left from collections import Counter import math def delete_folders(): """...
2.46875
2
test/binaries/foo_v1.py
drmikecrowe/cod
405
12782809
#!/usr/bin/env python3 """ Usage: foo [OPTION]... --foo1 useful option foo --bar1 useful option bar """ import sys if __name__ == "__main__": print(__doc__, file=sys.stderr)
1.710938
2
panos_update_panorama_upload/content_update_panorama_upload.py
scotchoaf/fw_content_update
0
12782810
<filename>panos_update_panorama_upload/content_update_panorama_upload.py # Copyright (c) 2018, Palo Alto Networks # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in ...
2.140625
2
tests/integration/helper.py
covx/graypy_v6
181
12782811
<filename>tests/integration/helper.py #!/usr/bin/env python # -*- coding: utf-8 -*- """helper functions for testing graypy with a local Graylog instance""" from time import sleep from uuid import uuid4 import requests def get_unique_message(): return str(uuid4()) DEFAULT_FIELDS = [ "message", "full_m...
2.3125
2
examples/long_example.py
AdrieanKhisbe/logupdate.py
5
12782812
<gh_stars>1-10 from logupdate import logupdate from time import sleep logupdate("This is gonna be...") sleep(1) logupdate("This is gonna be a very very very long example") sleep(3) logupdate("This is gonna be a very very very long example with very very long lines that span over terminal size") sleep(3) logupdate( ...
1.929688
2
tests/test_system.py
adamzhang1987/bt-python-sdk
4
12782813
import unittest import warnings from pybt.system import System from pybt.exceptions import InvalidAPIKey from .config import CONFIG class ClientTestCase(unittest.TestCase): def setUp(self): warnings.simplefilter('ignore', ResourceWarning) self.api = System(CONFIG.get("panel_address"), CONFIG.get(...
2.390625
2
softwares/houdini_wizard/export/modeling.py
Wizard-collab/wizard_2
1
12782814
# coding: utf-8 # Author: <NAME> # Contact: <EMAIL> # Python modules import traceback import os import logging logger = logging.getLogger(__name__) # Wizard modules from houdini_wizard import wizard_tools from houdini_wizard import wizard_export # Houdini modules def main(): scene = wizard_export.save_or_save_...
2.078125
2
code/data_analysis_2.py
PrideLee/CCFDF-Personalized-Matching-Model-of-Packages-for-Telecom-Users
0
12782815
<filename>code/data_analysis_2.py import pandas as pd import numpy as np import random import matplotlib.pyplot as plt def scater_service_type(att): type_0 = raw_data[raw_data["current_service"] == 89016252][att].tolist() type_1 = raw_data[raw_data["current_service"] == 89016253][att].tolist() type_2 = ra...
2.78125
3
spartan/expr/__init__.py
MaggieQi/spartan
0
12782816
#!/usr/bin/env python """ Definitions of expressions and optimizations. In Spartan, operations are not performed immediately. Instead, they are represented using a graph of `Expr` nodes. Expression graphs can be evaluated using the `Expr.evaluate` or `Expr.force` methods. The `base` module contains the definition ...
2.609375
3
data_preprocessing/utils/match_lat_lon.py
facebookresearch/Context-Aware-Representation-Crop-Yield-Prediction
12
12782817
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. def match_lat_lon(lats_from, lons_from, lats_to, lons_to, expand=0): i_lat_start = i_lat_end = i_lon_start = i_lon_...
3.359375
3
tests/declarative.py
drowse314-dev-ymat/lexical-knowledge-base-for-japanese-civil-law
1
12782818
<gh_stars>1-10 # encoding: utf-8 from attest import ( Tests, assert_hook, raises, contextmanager, ) import rdflib from lkbutils import declarative from lkbutils.relationprovider import RedundantRelation, Cyclic termloader_unit = Tests() relationloader_unit = Tests() @contextmanager def new_rdflib_termloade...
2.234375
2
detector.py
neutrons/Qikr
0
12782819
<filename>detector.py import mcvine, mcvine.components from mcni.AbstractComponent import AbstractComponent from mcni.utils import conversion import numpy as np import os from mcni import neutron_buffer, neutron class Detector(AbstractComponent): "2D detector center a (0,0,0) and perpendicular to z" def __in...
3.078125
3
py/text2img.py
walker-zheng/code
4
12782820
#! /usr/bin/python # -*- coding: utf-8 -*- ''' # 使用 convert(ImageMagick) 转换png为gif图片: ls |sed 's/\(.*\).png/convert \1.png -flatten -channel A -threshold 0% \1.gif/g' # cx-freeze打包: Python setup.py build Python setup.py bdist_msi ''' from os import mkdir from os import walk from os import path from os import getcwd ...
2.515625
3
warpfield/telescope.py
xr0038/jasmine_warpfield
0
12782821
#!/usr/bin/env python # -*- coding: utf-8 -*- from dataclasses import dataclass, field from typing import Callable, List from astropy.coordinates import SkyCoord, Longitude, Latitude, Angle from astropy.time import Time from astropy.units.quantity import Quantity from astropy.wcs import WCS from astropy.visualization.w...
2.953125
3
tests/hurricane_yz/plot_hurricane_yz.py
drreynolds/sundials_manyvector_demo
2
12782822
#!/usr/bin/env python3 #------------------------------------------------------------ # Programmer(s): <NAME> @ SMU #------------------------------------------------------------ # Copyright (c) 2019, Southern Methodist University. # All rights reserved. # For details, see the LICENSE file. #----------------------------...
2.90625
3
tests/test_installation_commands.py
figufema/TesteClone
1,521
12782823
# -*- coding: utf-8 -*- # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
1.664063
2
galini/relaxations/continuous.py
michaelbynum/galini
0
12782824
# Copyright 2018 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
2.4375
2
relevanceai/dataset/write/__init__.py
RelevanceAI/RelevanceAI
21
12782825
<filename>relevanceai/dataset/write/__init__.py from relevanceai.dataset.write.write import Write
1.289063
1
ideas/web/doc-viewer/service/utils/hasher.py
ctfcup/2019-task-based
1
12782826
from math import sin from wsgi import HASH_SALT def calculate_hash(data: str) -> str: return _calculate_inner(HASH_SALT + data) def _calculate_inner(data: str) -> str: A = 0x12345678 B = 0x9ABCDEF0 C = 0xDEADDEAD D = 0xC0FEC0FE E = 0xFEEDBEAF X = [int(0xFFFFFFFF * sin(i)) & 0xFFFFFFFF fo...
2.640625
3
warning_exceptions.py
lmokto/allexceptions
0
12782827
''' Warning Categories There are also several exceptions defined for use with the warnings module. Warning The base class for all warnings. UserWarning Base class for warnings coming from user code. DeprecationWarning Used for features no longer being maintained. PendingDeprecationWarning Used for f...
1.648438
2
comch/cubical/__init__.py
smimic/comch
4
12782828
<gh_stars>1-10 from .cubical import Cube from .cubical import CubicalElement from .cubical import Cubical
1.117188
1
khan/formatter/__init__.py
globocom/mongo-top
0
12782829
<reponame>globocom/mongo-top import sys import inspect from .table_top import TopTable from .table_replication import ReplicationTable def formatter_factory(command_name): klasses = inspect.getmembers(sys.modules[__name__], inspect.isclass) for klass in klasses: if klass[1].__formatter_name__ == comman...
2.140625
2
tests/test_consumer_group.py
Yelp/yelp_kafka
40
12782830
<gh_stars>10-100 # -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
1.835938
2
models.py
ymkjp/pytalki
0
12782831
<filename>models.py # -*- coding: utf-8 -*- from sqlalchemy import Column, Integer, String, DateTime, Boolean, DATETIME, Index from sqlalchemy.schema import Column, ForeignKey, Table, UniqueConstraint from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relation, backref from faker import...
2.390625
2
GCSs_filtering_and_overlapping.py
sutormin94/TopoI_Topo-Seq_1
0
12782832
############################################### ##<NAME>, 2018## ##Topo-Seq analysis## #The script takes raw GCSs data, returns only trusted GCSs, #computes GCSs shared between different conditions, #draws Venn diagrams of the sets overlappings, #writes GCSs sets. ############################################### ##...
2.296875
2
BeeFiles/Bee.py
Nezgun/Exploring-Bees
0
12782833
<filename>BeeFiles/Bee.py # -*- coding: utf-8 -*- #from DataStorageSystems.Stack import Stack #from DataStorageSystems.LinkedList import LinkedList class Bee(object): def __init__(self, location, name, home): #General Bee Metadata self._home = home self._name = name #Bee's ID self....
2.484375
2
program/transformer/if_transformer.py
mmsbrggr/polar
2
12782834
<reponame>mmsbrggr/polar from typing import List from singledispatchmethod import singledispatchmethod from program.condition import TrueCond, And, Not, Condition from program.ifstatem import IfStatem from program.assignment import Assignment, PolyAssignment from program.transformer.transformer import TreeTransformer...
2.609375
3
datareturn/settings.py
PersonalGenomesOrg/datareturn
0
12782835
<gh_stars>0 import os from django.conf import global_settings from env_tools import apply_env # Apply the environment variables in the .env file. apply_env() BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production EMAIL_BACKEND = 'djan...
1.601563
2
recipes/recipe_modules/third_party_packages/examples/go.py
xinghun61/infra
2
12782836
<filename>recipes/recipe_modules/third_party_packages/examples/go.py # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # """Recipe for Go toolchain building. During testing, it may be useful to focus on buil...
1.796875
2
thesaurus.py
xnaas/custom-bot-commands
0
12782837
""" Original author: xnaas (2022) License: The Unlicense (public domain) """ import requests from sopel import plugin, formatting from sopel.config.types import StaticSection, ValidatedAttribute class ThesaurusSection(StaticSection): api_key = ValidatedAttribute("api_key", str) def setup(bot): bot.config.de...
2.296875
2
app/lists/serializers.py
marcosvbras/inimex-api
0
12782838
<reponame>marcosvbras/inimex-api from rest_framework import serializers from rest_framework.pagination import PageNumberPagination from django.conf import settings from .models import MyList class MyListSerializer(serializers.ModelSerializer): class Meta: model = MyList fields = '__all__' class MyListPaginatio...
2
2
mkab/config.py
grplyler/mkab
0
12782839
import os os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = os.path.expanduser('~/.key.json')
1.398438
1
migrations/versions/640_add_framework_agreement_version_to_.py
uk-gov-mirror/alphagov.digitalmarketplace-api
25
12782840
<reponame>uk-gov-mirror/alphagov.digitalmarketplace-api """add framework_agreement_version to Framework Revision ID: 640 Revises: 630 Create Date: 2016-06-16 11:37:21.802880 """ # revision identifiers, used by Alembic. revision = '640' down_revision = '630' from alembic import op import sqlalchemy as sa def upgra...
1.164063
1
hphp/tools/gdb/gdbutils.py
tmotyl/hiphop-php
1
12782841
""" Assorted utilities for HHVM GDB bindings. """ # @lint-avoid-python-3-compatibility-imports import collections import functools import gdb #------------------------------------------------------------------------------ # Memoization. def memoized(func): """Simple memoization decorator that ignores **kwargs."...
2.4375
2
segar/tasks/billiards.py
fgolemo/segar
19
12782842
__copyright__ = "Copyright (c) Microsoft Corporation and Mila - Quebec AI Institute" __license__ = "MIT" """Billiards game """ __all__ = ("billiards_default_config", "Billiards", "BilliardsInitialization") import math from typing import Optional import numpy as np from segar.mdps.initializations import ArenaInitia...
2.375
2
powergate/parse_manually_updated_jobs.py
deplatformr/open-images
2
12782843
import os import sqlite3 from datetime import datetime abs_path = os.getcwd() split = os.path.split(abs_path) workflow_db_path = os.path.join( split[0], "pipeline/deplatformr_open_images_workflow.sqlite") workflow_db = sqlite3.connect(workflow_db_path) cursor = workflow_db.cursor() utctime = datetime.utcnow() ...
2.5625
3
nnfs/datasets/mnist.py
tblut/NNFS
0
12782844
<filename>nnfs/datasets/mnist.py import numpy as np from pathlib import Path from nnfs.utils import download_file def _read_images_file(path): with open(path, mode='rb') as file: data = file.read() n_images = int.from_bytes(data[4:8], byteorder='big', signed=True) width = int.from_bytes(data[8:12...
3.015625
3
utility/massFractionsEagleXG.py
jrminter/dtsa2scripts
2
12782845
# -*- coding: utf-8 -*- """ DTSA-II Script - <NAME> - 2018-07-30 massFractionsEagleXG.py Date Who Comment ---------- --- ----------------------------------------------- 2018-07-30 JRM Mass fractions the easy way for EagleXG rev sort 2018-10-02 JRM Change name to remove spaces. This made it easier ...
1.210938
1
6.NAS.py
yassine-afrouni/network-automation
0
12782846
# NAS.py # Network automation sys # # Created by yassen on 5/6/20. # Copyright © 2021 yassen & nouhaila. All rights reserved. from netmiko import ConnectHandler from netmiko.ssh_exception import NetMikoTimeoutException, AuthenticationException from paramiko.ssh_exception import SSHException import getpass from ti...
2.125
2
vendor-local/src/basket-client/basket/__init__.py
satdav/mozillians
0
12782847
from base import (send_sms, subscribe, unsubscribe, user, update_user, debug_user, BasketException)
0.960938
1
hubspot/crm/extensions/accounting/models/accounting_app_urls.py
cclauss/hubspot-api-python
0
12782848
# coding: utf-8 """ Accounting Extension These APIs allow you to interact with HubSpot's Accounting Extension. It allows you to: * Specify the URLs that HubSpot will use when making webhook requests to your external accounting system. * Respond to webhook calls made to your external accounting system by HubSp...
2.15625
2
tests/chainer_tests/training_tests/updaters_tests/test_standard_updater.py
belldandyxtq/chainer
1
12782849
<gh_stars>1-10 import unittest import mock import numpy import chainer from chainer.backends import _cpu from chainer.backends import cuda from chainer import dataset from chainer import testing from chainer.testing import attr from chainer import training class DummyIterator(dataset.Iterator): epoch = 1 i...
2.21875
2
landing/models.py
okfnepal/election-nepal
31
12782850
from __future__ import unicode_literals from mezzanine.core import fields from mezzanine.pages.models import Page from django.db import models DATASET_TYPES = [ ('Voters', 'Voters'), ('Candidates', 'Candidates'), ('Political Parties', 'Political Parties'), ('Federal', 'Federal'), ('Results', 'Re...
1.804688
2