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
src/alertas/alerta_prcr.py
MinisterioPublicoRJ/Alertas
2
12764251
<gh_stars>1-10 #-*-coding:utf-8-*- from pyspark.sql.types import IntegerType, TimestampType from pyspark.sql.functions import * from base import spark from utils import uuidsha columns = [ col('docu_dk').alias('alrt_docu_dk'), col('docu_nr_mp').alias('alrt_docu_nr_mp'), col('docu_orgi_orga_dk_responsavel...
2.359375
2
tests/generators/ios/test_ios_template_methods.py
brianleungwh/signals
3
12764252
import unittest from signals.generators.ios.ios_template_methods import iOSTemplateMethods from signals.parser.fields import Field from signals.parser.api import GetAPI, API, PatchAPI from tests.utils import create_dynamic_schema class iOSTemplateMethodsTestCase(unittest.TestCase): def test_get_url_name(self): ...
2.484375
2
calf/logging.py
brutasse/calf
2
12764253
<filename>calf/logging.py import json import syslog levels = {level: getattr(syslog, 'LOG_{}'.format(level.upper())) for level in ['emerg', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug']} log_level = levels['info'] def set_level(level): global log_level log_l...
2.265625
2
pgv_example.py
MelyPic/labgaif
0
12764254
<filename>pgv_example.py from itertools import product import pygraphviz as pgv d = pgv.AGraph(compound = "True") # compound allows for edge clipping at clusters d.add_edges_from(product('ABCD', 'FGH')) d.add_subgraph(nbunch = 'BC', name = 'clusterBC', style = 'filled', color = 'yellow') d.add_node('X') d.add_edge('X'...
3
3
modules/__init__.py
tinnguyen96/partition-coupling
0
12764255
# todos # add a compress function (triple Mode can create over 1000 files in a directory, which # put strain on Supercloud).
1.070313
1
examples/single_objective/test_1/ea_config_ex_1.py
gmonterovillar/HAMON
4
12764256
<reponame>gmonterovillar/HAMON ##============================ ea_config_ex_1.py ================================ # Some of the input parameters and options in order to select the settings of the # evolutionary algorithm are given here for the minimization of the De Jong’s fifth # function or Shekel’s foxholes using Ge...
1.835938
2
pre-commit.py
nim65s/scripts
1
12764257
<gh_stars>1-10 #!/usr/bin/env python3 from subprocess import check_output from sys import exit from flake8.main import application, git from isort import SortImports def hook(lazy=False, strict=False): """Execute Flake8 on the files in git's index. Determine which files are about to be committed and run Fl...
2.28125
2
great_expectations/datasource/generator/filesystem_path_generator.py
scarrucciu/great_expectations
0
12764258
<gh_stars>0 import os import time import glob from great_expectations.datasource.generator.batch_generator import BatchGenerator from great_expectations.exceptions import BatchKwargsError KNOWN_EXTENSIONS = ['.csv', '.tsv', '.parquet', '.xls', '.xlsx', '.json'] class GlobReaderGenerator(BatchGenerator): def __i...
2.171875
2
modules/viewers/histogram1D.py
chrisidefix/devide
25
12764259
<filename>modules/viewers/histogram1D.py from external import wxPyPlot import gen_utils from module_base import ModuleBase from module_mixins import IntrospectModuleMixin import module_utils try: import Numeric except: import numarray as Numeric import vtk import wx class histogram1D(IntrospectModuleMixi...
2.453125
2
model_short.py
evantey14/glow
0
12764260
import numpy as np import tensorflow as tf import tfops_short as Z class model: def __init__(self, sess, hps, train_iterator, data_init): # === Define session self.sess = sess self.hps = hps # === Input tensors with tf.name_scope('input'): s_shape = [None, hps....
2.265625
2
noggin/security/ipa_admin.py
mohanboddu/noggin
0
12764261
import random from functools import wraps from .ipa import Client class IPAAdmin(object): __WRAPPED_METHODS = ("user_add", "user_show", "user_mod", "group_add_member") __WRAPPED_METHODS_TESTING = ( "user_del", "group_add", "group_del", "group_add_member_manager", "pwp...
2.3125
2
LEO_calc_coating_from_meas_scat_amp_and_write_to_db.py
annahs/atmos_research
2
12764262
<filename>LEO_calc_coating_from_meas_scat_amp_and_write_to_db.py import sys import os import datetime import pickle import numpy as np import matplotlib.pyplot as plt from pprint import pprint import sqlite3 import calendar from datetime import datetime #id INTEGER PRIMARY KEY AUTOINCREMENT, #sp2b_file TEXT, #file_in...
2.15625
2
scripts/gaze/object_tracking.py
isi-vista/adam-visual-perception
1
12764263
""" Test Object Tracking This script receives a .tsv file as input which has already been labelled and runs the four selected objects tracking algorithm on all videos. The target object that is being gazed at by the person is presented in blue. Parameters ---------- tsv_path : str, optional Path to tsv file conta...
2.703125
3
push_deployment.py
eyalatox/Tableau-dummy
0
12764264
import os def validate_helm_chart(helm_chart): os.system(f'helm lint {helm_chart}')
1.585938
2
plugins/pelican-plugins/pelicanfly/pelicanfly/tests/test_pelicanfly.py
dbgriffith01/blog_source
0
12764265
# -*- coding: utf-8 -*- import os from shutil import rmtree from tempfile import mkdtemp import unittest from pelican import Pelican from pelican.settings import read_settings from pelican.tests.support import mute from fontawesome_markdown import FontAwesomeExtension import pelicanfly CURRENT_DIR = os.path.dirname(...
2.15625
2
test.py
tetzng/the-beatles-member-classifier
0
12764266
<reponame>tetzng/the-beatles-member-classifier #!/usr/bin/env python # -*- coding: utf-8 -*- import sys import cv2 import random import numpy as np import tensorflow as tf NUM_CLASSES = 4 IMAGE_SIZE = 28 IMAGE_PIXELS = IMAGE_SIZE*IMAGE_SIZE*3 flags = tf.app.flags FLAGS = flags.FLAGS flags.DEFINE_string('train', './da...
2.625
3
cax/tasks/process_hax.py
XENON1T/cax
2
12764267
<filename>cax/tasks/process_hax.py """Process raw data into processed data Performs batch queue operations to run pax. """ import sys import os import pax import hax from cax import qsub, config from cax.task import Task def init_hax(in_location, pax_version, out_location): hax.init(experiment='XENON1T', ...
2.453125
2
src/setup.py
w0bos/onifw
6
12764268
#!/usr/bin/env python from distutils.core import setup setup( name="onifw", version="1.13", description="pentest framework", author="w0bos", author_email="<EMAIL>", packages=["packaging"] )
0.828125
1
helper/degree_ratio.py
raindroid/GoldMiner-Verilog
2
12764269
from math import * if __name__ == "__main__": print(""" //To access data (signX[degree/2] ? -1 : 1) * absX[degree / 2 * 10 + 9 : degree / 2 * 10] / 100 module trigonometry( input clock, enable, output [1799: 0] absX, absY, output [179:0] signX, signY ); wire [1799: 0] rx, ry; wire [180:0] rsx, rsy; a...
3.40625
3
cobs/examples/add_occupancy_example.py
odtoolkit/COBS
0
12764270
""" This is an example of how to add the occupancy into the model. """ from cobs import Model Model.set_energyplus_folder("D:\\Software\\EnergyPlus\\") mode = 1 model = Model(idf_file_name="../data/buildings/5ZoneAirCooled.idf", weather_file="../data/weathers/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.e...
2.46875
2
normalizer.py
stackdumper/wot-vehicles-classifier
0
12764271
<reponame>stackdumper/wot-vehicles-classifier # normalize data 0-1 def normalize(data): normalized = [] for i in range(len(data[0])): col_min = min([item[i] for item in data]) col_max = max([item[i] for item in data]) for q, item in enumerate([item[i] for item in data]): ...
2.828125
3
open_spiel/python/examples/cfr_ma_autobattler_meta.py
opcheese/open_spiel
0
12764272
<gh_stars>0 # Copyright 2019 DeepMind Technologies Limited # # 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 applicabl...
1.976563
2
utils/parse_rose_total.py
JMB-McFarlane/SLICE
0
12764273
import subprocess import os import random import math scores = [] frame = [] workingdir = str(os.getcwd()) for file in os.listdir(workingdir): mod = -1 if os.path.isdir(file) == True: subdir = workingdir +'/'+ file + "/PROD/" print subdir os.popen("cd " + subdir) subprocess.cal...
2.4375
2
2_conditional_experiments/03_baseline_with_labels/fid_graph.py
Florian-Barthel/stylegan2
0
12764274
<gh_stars>0 from graphs.fid_graph import plot_multiple_runs plot_multiple_runs( run_paths=[ './../results/00184-stylegan2-car_images_512-2gpu-baseline_without_labels', './../results/00121-stylegan2-cars_v5_512-2gpu-baseline' ], descriptions=[ 'Baseline without Labels', 'Bas...
1.835938
2
transmission_tui/tms_app.py
ironsigma/transmission-tui
0
12764275
<filename>transmission_tui/tms_app.py<gh_stars>0 """The Transmission text based user interface application module.""" import curses import logging import time from .daemon import TransmissionDaemon from .logging_config import config_logging from .transfer_list import TransferList class TransmissionApp(): """The...
2.453125
2
hiku/expr/refs.py
brabadu/hiku
58
12764276
from ..query import Node, Link, Field, merge from ..types import GenericMeta, RecordMeta, SequenceMeta, MappingMeta from ..types import OptionalMeta, get_type from .nodes import NodeVisitor # TODO: revisit this _CONTAINER_TYPES = ( OptionalMeta, SequenceMeta, MappingMeta, RecordMeta, ) class Ref: ...
2.25
2
pype/hosts/hiero/__init__.py
Yowza-Animation/pype
0
12764277
<gh_stars>0 import os from pype.api import Logger from avalon import api as avalon from pyblish import api as pyblish from pype import PLUGINS_DIR from .workio import ( open_file, save_file, current_file, has_unsaved_changes, file_extensions, work_root ) from .menu import ( install as menu...
1.960938
2
generate.py
priyavrat-misra/scifi-lorem
0
12764278
<gh_stars>0 import torch import argparse import pyperclip from network import CharRNN from infer_utils import sample parser = argparse.ArgumentParser( prog='SciFi Lorem', description='generate random *meaningful* sci-fi text' ) parser.add_argument('-S', '--save_path', type=str, metavar='', ...
2.5
2
notes/algo-ds-practice/problems/list/copy_list_random_pointer.py
Anmol-Singh-Jaggi/interview-notes
6
12764279
''' You are given a linked list with one pointer of each node pointing to the next node just like the usual. Every node, however, also has a second pointer that can point to any node in the list. Now write a program to deep copy this list. Solution 1: First backup all the nodes' next pointers node to another array. n...
4.125
4
Botnets/SquidNet.py
Egida/Ethical-Hacking-Scripts
29
12764280
<reponame>Egida/Ethical-Hacking-Scripts import random, socket, time, sys, threading, random, os, hashlib, datetime, sqlite3 try: """This Module comes with Paramiko.""" from cryptography.fernet import Fernet except: pass from optparse import OptionParser """This script is NOT Perfected(Still a WIP)! N...
2.4375
2
lib/database.py
Huyu2239/GChub
6
12764281
<reponame>Huyu2239/GChub<filename>lib/database.py import asyncpg from typing import Any, List, Optional from dataclasses import dataclass import os @dataclass class Gchat: """Class for global chat data.""" gchat_id: str owner_id: int style: int color_code: int password: str @dataclass class ...
2.75
3
migrations/versions/216378370ae4_third_migration.py
wanjikuciku/Blog
0
12764282
<gh_stars>0 """Third Migration Revision ID: 216378370ae4 Revises: <PASSWORD> Create Date: 2019-02-19 05:51:40.716914 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '216378370ae4' down_revision = '<PASSWORD>' branch_lab...
1.398438
1
backend/web/app.py
d2hydro/hydrobase
0
12764283
<gh_stars>0 """Äpp of HydroBase API.""" from typing import List from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import FileResponse, StreamingResponse from pydantic import BaseModel import zipfile import json try: from .config import STATIC, DATA, __title__,...
2.34375
2
src/python/pants/java/nailgun_executor.py
WamBamBoozle/pants
0
12764284
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import hashlib impor...
2.140625
2
websocketpp/conanfile.py
kapilsh/conan-scripts
0
12764285
from conans import ConanFile, CMake from conans.tools import unzip, download import os import shutil class WebsocketppConan(ConanFile): name = "websocketpp" boost_version = "1.68.0" openssl_version = "1.1.1" zlib_version = "1.2.11" with open(os.path.join(os.path.dirname(os.path.realpath( ...
2.109375
2
spikeextractors/extractors/mdaextractors/__init__.py
zekearneodo/spikeextractors
145
12764286
from .mdaextractors import MdaRecordingExtractor, MdaSortingExtractor
1.070313
1
release/stubs.min/Rhino/DocObjects/__init___parts/PointCloudObject.py
htlcnn/ironpython-stubs
182
12764287
<reponame>htlcnn/ironpython-stubs<filename>release/stubs.min/Rhino/DocObjects/__init___parts/PointCloudObject.py class PointCloudObject(RhinoObject): # no doc def DuplicatePointCloudGeometry(self): """ DuplicatePointCloudGeometry(self: PointCloudObject) -> PointCloud """ pass PointCloudGeometry=property(lam...
1.75
2
Chapter_1_Introduction/Easy_Problems/kattis_lineup.py
BrandonTang89/CP4_Code
2
12764288
''' Kattis - lineup Compare list with the sorted version of the list. Time: O(n log n), Space: O(n) ''' n = int(input()) arr = [input() for _ in range(n)] if arr == sorted(arr): print("INCREASING") elif arr == sorted(arr, reverse=True): print("DECREASING") else: print("NEITHER")
3.984375
4
src/data/clean_raw_data.py
ereidelbach/pubg
1
12764289
#!/usr/bin/env python3.7 # -*- coding: utf-8 -*- """ Created on Mon Feb 4 15:45:33 2019 @author: ejreidelbach :DESCRIPTION: :REQUIRES: :TODO: """ #============================================================================== # Package Import #==================================================================...
2.09375
2
mtp_noms_ops/urls.py
ministryofjustice/money-to-prisoners-noms-ops
3
12764290
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.i18n import i18n_patterns from django.http import HttpResponse from django.shortcuts import redirect from django.template.response import TemplateResponse from django.urls import reverse, reverse_lazy from django.utils.tran...
1.90625
2
pinpoint/VideoReader.py
varma88/pinpoint
6
12764291
#! /usr/bin/env python """ Copyright 2015-2018 <NAME> <<EMAIL>> 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...
2.796875
3
chess/__init__.py
Jonxslays/Chess
1
12764292
"""Chess...""" __all__ = ["Game"] __version__ = "0.1.0" __author__ = "Jonxslays" from .game import Game
1.109375
1
setup.py
rpavlik/edid-json-tools
2
12764293
#!/usr/bin/env python3 # Copyright (c) 2019-2021 The EDID JSON Tools authors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # We need this stub of a script to be able to handle `pip install --editable .` import setuptools setuptools.setup()
1.09375
1
anomalydetection.py
RxstydnR/LEA-Net
0
12764294
<reponame>RxstydnR/LEA-Net import os import warnings warnings.simplefilter('ignore') # os.environ["CUDA_VISIBLE_DEVICES"] = "4" os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import gc import argparse import numpy as np import pandas as pd from sklearn.metrics import classification_report,confusion_matrix,f1_score import t...
2.203125
2
tool/runners/cython_aoc-setup.py
TPXP/adventofcode-2019
8
12764295
import os import sys from distutils.core import setup from Cython.Build import cythonize CYTHON_DEBUG = bool(os.getenv('CYTHON_DEBUG', '')) build_dir = sys.argv.pop() script_name = sys.argv.pop() setup( ext_modules=cythonize( script_name, build_dir=build_dir, quiet=not CYTHON_DEBUG, ...
1.71875
2
emulator/utils/helpers.py
Harry45/emuPK
2
12764296
<reponame>Harry45/emuPK # Author: (Dr to be) <NAME> # Collaborators: Prof. <NAME>, Prof. <NAME>, Dr. <NAME> # Email : <EMAIL> # Affiliation : Imperial Centre for Inference and Cosmology # Status : Under Development ''' Important functions to store/load files in a compressed format. ''' import os import numpy as np im...
3.828125
4
object_tracking.py
olubiyiontheweb/object_tracking_video
0
12764297
<gh_stars>0 import dlib import cv2 import numpy as np video = cv2.VideoCapture("people.mp4") if video.isOpened() == False: print("Error opening video") check, frame = video.read() if check == False: print("Cannot read video") cv2.imshow("first frame", frame) cv2.waitKey(0) bbox = cv2.sele...
2.9375
3
core/vtuber.py
zihochann/zihou
0
12764298
<gh_stars>0 from django.template import loader from core.models import Vtuber BILI_PREFIX = 'https://space.bilibili.com/' def get_bilibili_url(bili_id: str): return 'https://space.bilibili.com/{}/'.format(bili_id) if len(bili_id) >\ 0 else ''...
2.1875
2
algorithms/sorting/quick_sort.py
ramarajesh2112/algorithms
1
12764299
""" quick_sort.py Implementation of quick sort on a list and returns a sorted list. Quick Sort Overview: ------------------------ Uses partitioning to recursively divide and sort the list Time Complexity: O(n**2) worst case Space Complexity: O(n**2) this version Stable: No Psue...
3.984375
4
galaxy_common/models/namespace.py
alikins/galaxy-common-deprecated
0
12764300
# (c) 2012-2019, Ansible by Red Hat # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) any later version. # ...
1.882813
2
Filters/Modeling/Testing/Python/TestImprintFilter.py
cclauss/VTK
1,755
12764301
<reponame>cclauss/VTK<gh_stars>1000+ #!/usr/bin/env python import vtk # A simpler imprint test. One plane # imprints a second plane. # Control the resolution of the test res = 2 # Create the RenderWindow, Renderer # ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer( ren ) iren = vtk.vtkRende...
2.0625
2
modules/OfficialBERT.py
benywon/ComQA
15
12764302
<reponame>benywon/ComQA # -*- coding: utf-8 -*- """ @Time : 2021/1/14 下午5:21 @FileName: OfficialBERT.py @author: 王炳宁 @contact: <EMAIL> """ import torch import torch.nn as nn from transformers import AutoModel from torch.nn import functional as F from utils import load_file class OfficialBERT(nn.Module): ...
2.6875
3
examples/hello_world.py
Popeyef5/Cassandra
3
12764303
#!/usr/bin/env python3 if __name__ == '__main__': from cassandra.rockets import RandomRocket from cassandra.simulation import Simulation from cassandra.physics.integrators import RK4 SIM_TIME = 8 SIM_TIMESTEP = 0.01 rocket = RandomRocket() integrator = RK4() simulation = Simulation(rocket, integrat...
2.171875
2
ex056.py
heltonsdl/python-3---curso-em-video
0
12764304
somaidade = 0 mediaidade = 0 nomehomem = '' idadehomem = 0 totmulher20 = 0 ''' Desenvolva um programa que leia o nome, idade e sexo de 4 pessoas. No final do programa, mostre: a média de idade do grupo, qual é o nome do homem mais velho e quantas mulheres têm menos de 20 anos.''' for p in range (1,5): print...
3.84375
4
Lab_Dash/dash_plot_SEL_compare.py
SimonSchubotz/Electronic-Laboratory-Notebook
0
12764305
<reponame>SimonSchubotz/Electronic-Laboratory-Notebook<filename>Lab_Dash/dash_plot_SEL_compare.py import json import glob, os import dash import datetime import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import plotly.express as px from django_plotly_dash...
2.265625
2
img_loader.py
hujc7/yolo-v3
0
12764306
import os import random import torch # from torch.autograd import Variable from torchvision import transforms as T from PIL import Image, ImageDraw, ImageFont class IMGProcess(object): def __init__(self, source, use_cuda=True, img_path="imgs", batch_size=100, ...
2.359375
2
GooseSLURM/duration.py
tdegeus/slurm-epfl
0
12764307
import re def asSeconds(data, default=None): r""" Convert string to seconds. The following input is accepted: * A humanly readable time (e.g. "1d"). * A SLURM time string (e.g. "1-00:00:00"). * A time string (e.g. "24:00:00"). * ``int`` or ``float``: interpreted as seconds. :argu...
3.78125
4
main.py
richard-ma/spider-base-selenium
0
12764308
#!/usr/bin/env python import spider_base_selenium class MySpider(spider_base_selenium.Spider): def __init__(self): self.urls = [ 'http://www.baidu.com', 'http://www.bing.com', 'http://www.weibo.com', ] def parse(self, response): print(response.get_r...
2.828125
3
prototype.py
Jhko725/ProteinStructureReconstruction.jl
0
12764309
<reponame>Jhko725/ProteinStructureReconstruction.jl<gh_stars>0 #%% import numpy as np import matplotlib.pyplot as plt %matplotlib inline from skimage.io import imread from skimage.color import rgb2gray images = list(map(lambda x: np.float32(rgb2gray(imread(x))), ['./Data/SR2_desmin_image.jpg', './Data/SR3_actin_image....
2.03125
2
sdk/python/pulumi_azure_native/servicefabric/v20200101preview/_inputs.py
pulumi-bot/pulumi-azure-native
31
12764310
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
1.71875
2
T08/ex01.py
mariogarcc/comphy
0
12764311
from package import redact_ex from package import solve_explicit_ode import numpy as np EXERCISE_01 = """\ Make a program that is able to graphically solve the equation \u2202T/\u2202t = \u03B1 \u2202\u00B2T/\u2202x\u00B2 = 0 using the Forward in Time, Centered in Space (FTCS) scheme with Dirichlet boundary conditi...
3.109375
3
delft/textClassification/preprocess.py
tantikristanti/delft
333
12764312
import itertools import regex as re import numpy as np # seed is fixed for reproducibility np.random.seed(7) from tensorflow import set_random_seed set_random_seed(7) from unidecode import unidecode from delft.utilities.Tokenizer import tokenizeAndFilterSimple from delft.utilities.bert.run_classifier_delft import Data...
2.671875
3
src/scmodes/benchmark/deconvolution.py
aksarkar/scmodes
3
12764313
<filename>src/scmodes/benchmark/deconvolution.py import functools as ft import numpy as np import pandas as pd import rpy2.robjects.packages import rpy2.robjects.pandas2ri import scipy.special as sp import scipy.stats as st import sklearn.model_selection as skms import sys rpy2.robjects.pandas2ri.activate() def nb_ll...
2.25
2
bookorbooks/book/api/urls.py
talhakoylu/SummerInternshipBackend
1
12764314
<filename>bookorbooks/book/api/urls.py from book.api.views.book_page_views import BookPagesByBookIdAPIView from book.api.views.reading_history_views import AddReadingHistoryAPIView, ReadingHistoryByChildAPIView, ReadingHistoryByChildIdAPIView, ReadingHistoryListAllAPIView from book.api.views import AuthorDetailAPIView,...
2.203125
2
AI/face_detector.py
Vahegian/GIANT-ROBOT
2
12764315
import dlib if dlib.cuda.get_num_devices()>=1: print("Enabeling CUDA") dlib.DLIB_USE_CUDA = True dlib.USE_AVX_INSTRUCTIONS = True dlib.DLIB_USE_BLAS, dlib.DLIB_USE_LAPACK, dlib.USE_NEON_INSTRUCTIONS = True, True, True print(dlib.DLIB_USE_CUDA, dlib.USE_AVX_INSTRUCTIONS, dlib.DLIB_USE_BLAS, dlib.DLIB_USE...
2.75
3
django_project/autodidacticism/blog/migrations/0002_papermodel.py
MatthewTe/django_postings_project
0
12764316
<gh_stars>0 # Generated by Django 3.1.4 on 2020-12-23 20:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0001_initial'), ] operations = [ migrations.CreateModel( name='PaperModel', fields=[ ...
1.84375
2
react.py
viktorg1/discordpy-scripts
1
12764317
from discord.ext import commands bot = commands.Bot(command_prefix=',') @bot.command() async def react(ctx, id, emoji): message = await ctx.fetch_message(id) await message.add_reaction(emoji) # Usage: ,react [MESSAGE_ID] [EMOJI]
2.4375
2
init_db.py
nccr-itmo/FEDOT.Web
23
12764318
<filename>init_db.py<gh_stars>10-100 import os import pymongo from dotenv import load_dotenv from app.singletons.db_service import DBServiceSingleton from init.init_cases import create_default_cases from init.init_history import create_default_history from init.init_pipelines import create_default_pipelines if __nam...
2.046875
2
psyneulink/core/llvm/execution.py
bdsinger/PsyNeuLink
0
12764319
# Princeton University licenses this file to You 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 writin...
1.773438
2
coursinary_app/migrations/0009_auto_20200510_0741.py
ranybal17/Coursinary
0
12764320
<reponame>ranybal17/Coursinary<gh_stars>0 # Generated by Django 3.0.6 on 2020-05-10 07:41 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('coursinary_app', '0008_auto_20200510_0739'), ] operations = [ migrations.AlterField( m...
1.640625
2
offline_train.py
nivedithaparthasarathy50/mudrarecognitionDec242021
0
12764321
import cv2 import argparse import os data={"label_name":[],"no_of_video":[], "overall_fps":[]} def TrainingVideoFiles(video_location, video_name): files = [f for f in os.listdir(video_location)] data['label_name'].append(video_name) data['no_of_video'].append(len(files)) fps=0 try: os...
2.59375
3
app/providers/cloze.py
nerevu/rorschach
0
12764322
<filename>app/providers/cloze.py<gh_stars>0 # -*- coding: utf-8 -*- """ app.api ~~~~~~~~~~~~ Provides endpoints for pulling orders from OpenCart (pricecloser.com) into Cloze. Live Site: Endpoints: Visit the live site for a list of all available endpoints """ import json import os import time from datetime import...
2.09375
2
tests/pysphinx_autoindex/data/input/test-project/tests/test_class.py
suburbanmtman/pysphinx-autoindex
1
12764323
<reponame>suburbanmtman/pysphinx-autoindex # coding=utf-8 def test_method(param): """ Should not show up :param param: any param :return: None """ return None
1.945313
2
utils.py
Leaniz/gordologo
1
12764324
from unidecode import unidecode def compare_name(name_1, name_2): name_1 = unidecode(name_1).lower() name_2 = unidecode(name_2).lower() return name_1 == name_2
3.1875
3
main/migrations/0003_auto_20190525_0929.py
MenacingDwarf/HackGatchina
1
12764325
<gh_stars>1-10 # Generated by Django 2.2.1 on 2019-05-25 09:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0002_auto_20190525_0922'), ] operations = [ migrations.AlterField( model_name='sight', name='...
1.523438
2
lstm.py
iibrahimli/lstm-text-generation
2
12764326
<reponame>iibrahimli/lstm-text-generation from keras.models import Sequential from keras.layers import Dense, Dropout, LSTM from keras.callbacks import ModelCheckpoint from keras.utils import np_utils import numpy filename = "input.txt" raw_text = open(filename).read() raw_text = raw_text.lower() raw_text = [i for i i...
3.296875
3
personal/urls.py
KellenNjoroge/keller-gallery
0
12764327
from django.conf.urls import url from . import views from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url('^$',views.index,name='index'), url('^image/',views.single_image,name='single_image'), url('^location/',views.images_by_location,name='location'), url('^c...
1.9375
2
euler/p35.py
parin2092/cook
0
12764328
<reponame>parin2092/cook<filename>euler/p35.py import math n = 100 isPrime = [True for i in range(n)] isPrime[0] = False isPrime[1] = False isPrime[2] = True isPrime[3] = True def perm(arr,pre,curr): if len(curr) == 0: arr.append(pre) for i in xrange(len(curr)): perm(arr, pre+curr[i], curr[0:i]+curr[i+1:]) d...
3.25
3
Algorithms/implementation_drawing_book.py
suketm/hackerrank
0
12764329
<filename>Algorithms/implementation_drawing_book.py n = int(input()) p = int(input()) print (min(p//2, ((n + (n+1)%2)-p)//2 ))
3.375
3
labml_nn/gan/original/__init__.py
dongfangyixi/annotated_deep_learning_paper_implementations
1
12764330
""" --- title: Generative Adversarial Networks (GAN) summary: A simple PyTorch implementation/tutorial of Generative Adversarial Networks (GAN) loss functions. --- # Generative Adversarial Networks (GAN) This is an implementation of [Generative Adversarial Networks](https://arxiv.org/abs/1406.2661). The generator, $...
3.1875
3
Gallery/migrations/0011_auto_20210225_0853.py
CiganOliviu/InfiniteShoot
1
12764331
# Generated by Django 3.0.8 on 2021-02-25 08:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Gallery', '0010_pickedimage'), ] operations = [ migrations.RemoveField( model_name='pickedimage', name='cover_image'...
1.546875
2
wiki4codes/lib_and_frameworks/detectron2/vhelper/detectron2/DetectronModelMeta.py
innerNULL/wiki4codes
0
12764332
# -*- coding: utf-8 -*- # file: DetectronModelMeta.py # date: 2021-09-23 from multipledispatch import dispatch from detectron2 import model_zoo from .. import common class DetectronModelMeta(common.ModelMeta): def __init__(self, dataset: str, task: str, model: str, backbone: str ): se...
2.1875
2
tests/utils/test_coprime.py
reidhoch/oeis-seq
0
12764333
<filename>tests/utils/test_coprime.py # coding=utf-8 # flake8: noqa from math import gcd from hypothesis import given from hypothesis.strategies import integers from oeis.utils import coprime def lcm(x: int, y: int) -> int: return (x * y) // gcd(x, y) @given(a=integers(), b=integers()) def test_lcm_property(a...
2.75
3
docs/snippets/bus0_sync.py
husqvarnagroup/pynng
174
12764334
<reponame>husqvarnagroup/pynng import time from pynng import Bus0, Timeout address = 'tcp://127.0.0.1:13131' with Bus0(listen=address, recv_timeout=100) as s0, \ Bus0(dial=address, recv_timeout=100) as s1, \ Bus0(dial=address, recv_timeout=100) as s2: # let all connections be established time....
2.609375
3
scripts/jointcontroller_host.py
rachelmh/sawyer_rr_bridge
0
12764335
#!/usr/bin/env python import roslib roslib.load_manifest('sawyer_rr_bridge') import rospy import intera_interface from std_msgs.msg import Empty import sys, argparse import struct import time import RobotRaconteur as RR import thread import threading import numpy from geometry_msgs.msg import ( PoseStamped, P...
2.25
2
entertainment_center.py
azhurb/movie-trailer-website
1
12764336
import fresh_tomatoes import media # Create a data structure alien = media.Movie( "Alien", "During its return to the earth, commercial spaceship\ Nostromo intercepts a distress signal from a distant planet.", "https://image.tmdb.org/t/p/w640/2h00HrZs89SL3tXB4nbkiM7BKHs.jpg", "https://www.youtube.c...
2.75
3
applications/pytorch/cnns/tests/test_train.py
payoto/graphcore_examples
260
12764337
<gh_stars>100-1000 # Copyright (c) 2020 Graphcore Ltd. All rights reserved. import os import gc import pytest import shutil import torch import poptorch import popart from poptorch.optim import SGD import import_helper from train import TrainingModelWithLoss import datasets import models from utils import get_train_acc...
2.015625
2
python-package/entry_meta_pb2.py
openmit/openmit
15
12764338
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: entry_meta.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _re...
1.265625
1
macro/dumpEvent.py
Plamenna/proba
0
12764339
<filename>macro/dumpEvent.py # example for dumping an MC event import ROOT,os,sys,getopt import rootUtils as ut import shipunit as u import ShipGeoConfig ship_geo = ShipGeoConfig.Config().loadpy("$FAIRSHIP/geometry/geometry_config.py") PDG = ROOT.TDatabasePDG.Instance() def printMCTrack(n,MCTrack): mcp = MCTrack[n]...
2.25
2
main.py
boneyrox/Python-bot
0
12764340
<gh_stars>0 import os import random import math for i in range(50): d = str(math.floor(i + 133 +150*random.random())) + ' day ago' with open('bot.txt', 'a') as file: file.write(d) os.system('git add bot.txt') os.system('git commit --date="' + d + '" -m "first commit"') os.sy...
2.578125
3
gimp_be/core.py
J216/gimp_be
3
12764341
import gimp from gimp import pdb from settings import * from network import * from image import * from utils import * from draw import * from paint import * from collections import Counter import TwitterAPI from random import randrange, choice, shuffle from string import letters import datetime as dt from time import...
2.46875
2
Darlington/phase-3/python challenge/day 89 solution/qtn2.py
darlcruz/python-challenge-solutions
0
12764342
#program to find the single element appears once in a list where every element # appears four times except for one. class Solution_once: def singleNumber(self, arr): ones, twos = 0, 0 for x in arr: ones, twos = (ones ^ x) & ~twos, (ones & x) | (twos & ~x) assert twos == 0 ...
3.65625
4
modules/checker_email.py
dark0ghost/async_py_bot
24
12764343
import asyncio from email.mime.text import MIMEText from random import random, choice from aiosmtplib import SMTP class CheckerEmail: """ class for check email use : from CheckerMailPy import CheckerEmail from email.mime.text import MIMEText async def async_start() ->...
2.703125
3
doc/sphinxext/numpydoc/__init__.py
vimalromeo/pandas
303
12764344
from __future__ import division, absolute_import, print_function from .numpydoc import setup
0.972656
1
x.py
merny93/tornado
0
12764345
<filename>x.py import spinmob as s import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit from scipy.special import voigt_profile import spify import os #load pure copper data! #the new fitting fit needs to work with different h,k,l # Make a wrapper that will generate fitting functions...
2.265625
2
contrib/ruamel/__init__.py
reuterbal/ecbundle
0
12764346
__all__ = ["yaml"]
1.070313
1
MMA.py
wznpub/MMA_Regularization
8
12764347
import torch import torch.nn.functional as F import mxnet as mx def get_mma_loss(weight): ''' MMA regularization in PyTorch :param weight: parameter of a layer in model, out_features * in_features :return: mma loss ''' # for convolutional layers, flatten if weight.dim() > 2: weigh...
2.859375
3
modules/andes-core/perftests/bin/processing/processTests.py
bhathiya/andes
3
12764348
#!/usr/bin/env python # # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
1.9375
2
python/047 Permutations II.py
allandproust/leetcode-share
156
12764349
<filename>python/047 Permutations II.py ''' Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, [1,1,2] have the following unique permutations: [1,1,2], [1,2,1], and [2,1,1]. ''' class Solution(object): def permuteUnique(self, nums): ...
3.984375
4
copper/shout/parsers/ifd/binary_json.py
cinepost/Copperfield_FX
6
12764350
<reponame>cinepost/Copperfield_FX<filename>copper/shout/parsers/ifd/binary_json.py # This document is licensed under CC-3.0 Attribution-Share Alike 3.0 # http://creativecommons.org/licenses/by-sa/3.0/ # Attribution: There is no requirement to attribute the author. ''' A Python JSON parser (http://www.j...
2.140625
2