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
data/water/CMEMS_ocean_pH/viz/generate.py
ilopezgp/human_impacts
4
12762951
<filename>data/water/CMEMS_ocean_pH/viz/generate.py #%% import numpy as np import pandas as pd import altair as alt import anthro.io # Load the production data. data = pd.read_csv('../processed/CMEMS_average_ocean_pH.csv') data['year'] = pd.to_datetime(data['year'], format='%Y') data['pH'] = round(data['pH'], 3) #...
2.421875
2
utils/nuswide_dataset.py
stevehuanghe/multi_label_zsl
4
12762952
<reponame>stevehuanghe/multi_label_zsl import torch import torch.utils.data as data import torchvision.transforms as transforms import os from pathlib import Path import pickle import numpy as np from PIL import Image from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True import csv import copy class NUSWid...
2.4375
2
src/catsys/imgs/hgencoder.py
AtomCrafty/catsystem-py
6
12762953
#!/usr/bin/python # -*- coding: utf-8 -*- """HG image encoding utility Provides the encoding and decoding methods for HG image encodings (HG-2, HG-3). """ __version__ = '1.0.0' __date__ = '2020-09-19' __author__ = '<NAME>' __all__ = [] ############################################################################...
2.34375
2
tests/Usage.py
astronalta/gamepython
0
12762954
<filename>tests/Usage.py<gh_stars>0 import os os.system(os.path.join("..", "bin", "jogo") + " --help") os.system(os.path.join("..", "bin", "jogo") + " -h")
1.632813
2
frille-lang/lib/python3.6/site-packages/typer/completion.py
frillecode/CDS-spring-2021-language
1
12762955
import os import re import subprocess import sys from enum import Enum from pathlib import Path from typing import Any, Optional, Tuple import click import click._bashcomplete from .models import ParamMeta from .params import Option from .utils import get_params_from_function try: import shellingham except Impor...
2.140625
2
src/program/migrations/0042_auto_20170715_1547.py
flokli/bornhack-website
7
12762956
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-07-15 13:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("program", "0041_auto_20170711_2248")] operations = [ migrations.AddField( mo...
1.671875
2
harnessed_jobs/brighter_fatter_BOT/v0/bf_jh_task.py
duncanwood/EO-analysis-jobs
2
12762957
<filename>harnessed_jobs/brighter_fatter_BOT/v0/bf_jh_task.py #!/usr/bin/env ipython """ Script for BOT brighter-fatter analysis. """ def bf_jh_task(det_name): """JH version of single sensor execution of the brighter-fatter task.""" import glob import siteUtils from bot_eo_analyses import make_file_pref...
2.109375
2
tests/test_postprocessing/test_shap_explainer.py
moonson619/AI4Water-1
17
12762958
<filename>tests/test_postprocessing/test_shap_explainer.py import time import unittest import os import sys import site ai4_dir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))) site.addsitedir(ai4_dir) import shap import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn impo...
2.546875
3
cinema/movies/apps.py
kevinGarcia15/cinemaAPI
0
12762959
"""users apps""" #django from django.apps import AppConfig class MoviesAppConfig(AppConfig): """ Movies app config """ name = 'cinema.movies' verbose_name = 'Movies'
1.617188
2
aio_telegraph/__init__.py
bluzir/aio-telegraph
1
12762960
name = 'aio_telegraph'
0.996094
1
src/rez/utils/execution.py
alexey-pelykh/rez
0
12762961
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project """ Utilities related to process/script execution. """ from rez.vendor.six import six from rez.utils.yaml import dump_yaml from rez.vendor.enum import Enum from contextlib import contextmanager import subprocess import sys import stat ...
1.90625
2
tests/test_vlan/test_network.py
mteter-upenn/bacpypes
0
12762962
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Test Module Template -------------------- """ import unittest from bacpypes.debugging import bacpypes_debugging, ModuleLogger # some debugging _debug = 0 _log = ModuleLogger(globals()) @bacpypes_debugging def setup_module(): if _debug: setup_module...
2.375
2
include/ClientNetworkingSessions.py
MsgLosers/hydrus
0
12762963
import pickle from . import ClientConstants as CC from . import ClientNetworkingContexts from . import ClientNetworkingDomain from . import HydrusData from . import HydrusSerialisable from . import HydrusGlobals as HG import requests import threading try: import socket import socks SOCKS_PROXY_OK...
2.046875
2
src/users/schema.py
cbsBiram/xarala__ssr
0
12762964
from django.db.models.aggregates import Sum import graphene import graphql_jwt from django.conf import settings from django.contrib.auth.forms import PasswordChangeForm from django.db.models import Q from graphene_django import DjangoObjectType from graphene_django.forms.mutation import DjangoFormMutation from graphql ...
1.953125
2
config/api_router.py
devnelmar/Pokeindex-application
0
12762965
<reponame>devnelmar/Pokeindex-application from django.conf import settings from rest_framework.routers import DefaultRouter, SimpleRouter from pokeindexapi.users.api.views import UserViewSet from pokeindexapi.apps.pokedex.api.views import PokemonViewSet if settings.DEBUG: router = DefaultRouter() else: router...
1.65625
2
test/geocoders/geonames.py
hyper750/geopy
1
12762966
# -*- coding: UTF-8 -*- import unittest import uuid import pytz from geopy import Point from geopy.compat import u from geopy.exc import GeocoderAuthenticationFailure, GeocoderQueryError from geopy.geocoders import GeoNames from test.geocoders.util import GeocoderTestBase, env class GeoNamesTestCaseUnitTest(Geocode...
2.84375
3
tests/unit/trace/propagation/test_text_format.py
Flared/opencensus-python
650
12762967
<reponame>Flared/opencensus-python # Copyright 2017, OpenCensus Authors # # 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 ...
2.09375
2
cwr/grammar/factory/adapter.py
orenyodfat/CWR-DataApi
37
12762968
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod from cwr.grammar.field import basic, special, table, filename """ CWR fields grammar adapters. These classes allow the factories to create rules in an homogeneous way, by setting a basic interface which will wrap around field rules, giving a basic comm...
3.375
3
rpi_camera_code.py
AGarcia-20/Python_practice
1
12762969
<gh_stars>1-10 import time import RPi.GPIO as GPIO from picamera import PiCamera import os from subprocess import check_output from datetime import datetime import numpy as np from PIL import Image GPIO.setwarnings(Fal...
2.828125
3
tests/package1/subpackage1/__init__.py
sizrailev/py2reqs
0
12762970
from .module3 import foo3 as bar3 def foo(): bar3()
1.429688
1
seev/apps/core/views.py
Kairn/se-eon-venture
1
12762971
<reponame>Kairn/se-eon-venture """ View logic used in core app """ import traceback from django.conf import settings from django.http import HttpRequest from django.db import transaction from django.shortcuts import render, redirect, reverse from django.core.paginator import Paginator from django.core.exceptions impo...
1.757813
2
setup.py
Jingren-hou/NeuralCDE
438
12762972
<reponame>Jingren-hou/NeuralCDE<filename>setup.py import pathlib import setuptools here = pathlib.Path(__file__).resolve().parent with open(here / 'controldiffeq/README.md', 'r') as f: readme = f.read() setuptools.setup(name='controldiffeq', version='0.0.1', author='<NAME>', ...
1.539063
2
util/chplenv/chplenv.py
MayukhSobo/chapel
1,602
12762973
import chpl_cpu import chpl_atomics import chpl_aux_filesys import chpl_bin_subdir import chpl_make import chpl_platform import chpl_comm import chpl_comm_debug import chpl_comm_segment import chpl_comm_substrate import chpl_compiler import chpl_gasnet import chpl_gmp import chpl_hwloc import chpl_jemalloc import chpl_...
0.960938
1
tests/r/test_swahili.py
hajime9652/observations
199
12762974
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.swahili import swahili def test_swahili(): """Test module swahili.py by downloading swahili.csv and testing shape of extracted data has 48...
2.21875
2
ITE-428/basicproject2/MyLibrary.py
richeyphu/ITE-428-LAB
1
12762975
<reponame>richeyphu/ITE-428-LAB<filename>ITE-428/basicproject2/MyLibrary.py<gh_stars>1-10 # function declaration import math def line1(): print("-" * 35) def line2(ch): # line2('#') # print(ch * 35) print("{}".format(ch) * 35) def line3(ch, num): print("{}".format(ch) * num) de...
2.734375
3
updateAttendance.py
Shivani-781/AI-Powered-Hourly-Attendance-Capturing-System
0
12762976
import json import boto3 dynamo = boto3.resource("dynamodb") table = dynamo.Table("Attendance_Count") def lambda_handler(event, context): # TODO implement res = table.get_item(Key = {"RollNo" : event['RollNo']}) print(res['Item']['Name']) Count = res['Item']['Count'] Count= Count+1 ...
2.3125
2
src/cyborgbackup/main/management/commands/cleanup_jobs.py
ikkemaniac/cyborgbackup
0
12762977
# Python import datetime import logging # Django from django.core.management.base import BaseCommand, CommandError from django.db import transaction from django.utils.timezone import now # CyBorgBackup from cyborgbackup.main.models import Job, Repository class Command(BaseCommand): ''' Management command t...
2.21875
2
python_scripts_youtube/desafio16_final.py
diegocarloni/python
0
12762978
<filename>python_scripts_youtube/desafio16_final.py from math import trunc num = float(input('Digite um número: ')) print('A parte inteira de {} é igual a {}'.format(num, trunc(num)))
3.8125
4
src/SocialNetwork_API/services/user.py
mungpham/mungpham
0
12762979
import _thread import time import hashlib from django.core.exceptions import ValidationError from django.db import transaction from django.db.models import Q from django.conf import settings from django.template.defaultfilters import slugify from SocialNetwork_API.services.base import BaseService from SocialNetwork_A...
1.992188
2
nonebot_plugin_nokia/nokia.py
kexue-z/nonebot-plugin-nokia
3
12762980
import base64 from io import BytesIO from os.path import dirname from typing import Tuple from collections import deque from PIL import Image, ImageFont, ImageDraw, ImageOps font_size = 70 line_gap = 20 body_pos = (205, 340) subtitle_pos = (790, 320) body_color = (0, 0, 0, 255) subtitle_color = (129, 212, 250, 255) li...
2.90625
3
tests/unit/helpers/test_build_io.py
cicharka/epiphany
2
12762981
import os from collections import OrderedDict import pytest from ruamel.yaml import YAML from cli.src.helpers.build_io import (ANSIBLE_CFG_FILE, ANSIBLE_INVENTORY_FILE, ANSIBLE_OUTPUT_DIR, ANSIBLE_VAULT_OUTPUT_DIR, ...
1.976563
2
python/EXERCICIO 69 - ANALISE DE DADOS DO GRUPO.py
debor4h/exerciciosPython
1
12762982
<filename>python/EXERCICIO 69 - ANALISE DE DADOS DO GRUPO.py maiores = homens = mulheres = 0 while True: print('-'*30) print('CADASTRO DE PESSOA') print('-' * 30) idade = int(input('Qual sua idade: ')) sexo = ' ' while sexo not in 'M' and sexo not in 'F' : sexo = str(input('Qual seu sexo...
3.875
4
day-02/part-01.py
gregn610/advent2021
0
12762983
<filename>day-02/part-01.py eg = [ 'forward 5', 'down 5', 'forward 8', 'up 3', 'down 8', 'forward 2', ] def load(file): with open(file) as f: data = f.readlines() return data def steps(lines, pos_char, neg_char): directions = [ln.split(' ') for ln in lines if ln[0] in ...
3.46875
3
api/swagger_server/test/test_file_controller.py
fujitsu/controlled-vocabulary-designer
5
12762984
<filename>api/swagger_server/test/test_file_controller.py """ test_file_controller.py COPYRIGHT FUJITSU LIMITED 2021 """ # coding: utf-8 from __future__ import absolute_import from flask import json from six import BytesIO from swagger_server.models.check_error_response import CheckErrorResponse # noqa: E501 from s...
2.53125
3
tests/test_03_classification_audit_trends.py
carolinesadlerr/wiggum
5
12762985
# # Developing a classification Audit trend # # In first iteration, this will only work on datasets that already have two or more binary classification variables included. # # We will need additional metadata: role options of being predictions or ground truths. # import pytest import numpy as np import pandas as pd i...
2.578125
3
src/dewloosh/math/function/relation.py
dewloosh/dewloosh-math
2
12762986
# -*- coding: utf-8 -*- from enum import Enum import operator as op from typing import TypeVar, Callable from dewloosh.core.tools import getasany from .function import Function __all__ = ['Equality', 'InEquality'] class Relations(Enum): eq = '=' gt = '>' ge = '>=' lt = '<' le = '<=' def t...
2.359375
2
tests/database.py
AnthonyPerez/bigorm
0
12762987
""" python -m tests.database """ try: import _thread except ImportError: import thread as _thread from bigorm.database import BigQueryDatabaseContext as DatabaseContext from tests import UNIT_TEST_PROJECT def _open_context(): with DatabaseContext(project=UNIT_TEST_PROJECT): DatabaseContext.get_s...
2.40625
2
training/learnG.py
AIARTSJTU/ToyGAN_Zoo
0
12762988
<reponame>AIARTSJTU/ToyGAN_Zoo import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import random import math import sys import datetime import time from collections import namedtuple def print_now(cmd, file=None): time_now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') ...
2.140625
2
api/lms/models/location.py
hachimihamza/leavemanager
0
12762989
from django.db import models class Region(models.Model): region_name = models.CharField(max_length=30, primary_key=True) def __str__(self): return self.region_name class Country(models.Model): country_name = models.CharField(max_length=30, primary_key=True) region = models.ForeignKey(Region, on_delete=models....
2.484375
2
tests/test_helper.py
rsheeter/nanoemoji
3
12762990
<filename>tests/test_helper.py # Copyright 2020 Google 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 # # Unless required by applicabl...
2.0625
2
dsa_stl/testdsa.py
aman2000jaiswal14/dsa_stl
0
12762991
<gh_stars>0 def test(): print("test successful...") def update(): print("Updating DSA") if __name__=='__main__': pass
1.554688
2
nzmath/factor/find.py
turkeydonkey/nzmath3
1
12762992
<gh_stars>1-10 """ All methods defined here return one of a factor of given integer. When 1 is returned, the method has failed to factor, but 1 is a factor anyway. 'verbose' boolean flag can be specified for verbose reports. """ import logging import nzmath.arith1 as arith1 import nzmath.bigrandom as bigrandom import...
3.1875
3
cogs/dev.py
Hattyot/MuusikBot
1
12762993
<filename>cogs/dev.py import discord import ast import config import logging import psutil import copy import time import traceback from discord.ext import commands from config import DEV_IDS from modules import database, command, embed_maker from datetime import datetime from cogs.utils import get_member db = databas...
2.3125
2
s4gutils.py
perwin/s4g_barsizes
2
12762994
<reponame>perwin/s4g_barsizes # Miscellaneous code for analysis of S4G bar fractions import copy import math import random import numpy as np random.seed() # lower and upper bounds of 68.3% confidence interval: ONESIGMA_LOWER = 0.1585 ONESIGMA_UPPER = 0.8415 def Read2ColumnProfile( fname ): """Read in the (firs...
2.546875
3
test/requirements/test_rdf_source.py
denz/ldp
0
12762995
<filename>test/requirements/test_rdf_source.py """ ### 4.3 RDF Source The following section contains normative clauses for Linked Data Platform RDF Source. #### 4.3.1 General ##### 4.3.1.1 Each LDP RDF Source _MUST_ also be a conforming LDP Resource as defined in section 4.2 Resource, along with the restrictions in ...
1.515625
2
back-end/f1hub/constructors/schema.py
mmzboys/F1Hub
0
12762996
<reponame>mmzboys/F1Hub<gh_stars>0 import graphene from graphene_django import DjangoObjectType from .models import Constructor class ConstructorType(DjangoObjectType): class Meta: model = Constructor class Query(graphene.ObjectType): constructors = graphene.List(ConstructorType, name=graphene.Stri...
2.3125
2
address_extractor/street_type.py
shaynem/address_extractor
1
12762997
from address_extractor import datafile def load_street_types(): return set(line.strip().lower() for line in datafile.read_street_types()) STREET_TYPES = load_street_types() def is_valid(token): return token.lower() in STREET_TYPES
3
3
test_syntax.py
SlavaRa/as2cs
8
12762998
""" Concise grammar unit test format in definitions. definitions[definition]: [[input], [output]] Related to gUnit: Grammar unit test for ANTLR https://theantlrguy.atlassian.net/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing """ from glob import glob from unittest import main, TestCase from as2cs import cfg, co...
2.703125
3
test/terra/backends/test_qasm_stabilizer_simulator.py
eliarbel/qiskit-aer
0
12762999
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
1.78125
2
05_hydrothermal_venture.py
KanegaeGabriel/advent-of-code-2021
2
12763000
####################################### # --- Day 5: Hydrothermal Venture --- # ####################################### from collections import defaultdict import AOCUtils def get_overlap_count(vents, part_two=False): grid = defaultdict(int) for start, end in vents: delta = None if start[0] =...
3.09375
3
data_generation/convert_to_tfrecord.py
anguillanneuf/next18-ai-in-motion
10
12763001
<gh_stars>1-10 # Copyright 2018 Google 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 # # Unless required by applicable law or agreed t...
1.984375
2
apps/accounts/views/confirm_email.py
vicobits/django-wise
5
12763002
# -*- coding: utf-8 -*- from django.views import View from django.shortcuts import render from apps.accounts.models.choices import ActionCategory from apps.accounts.models.pending_action import PendingAction from apps.accounts.services.auth_service import AuthService class ConfirmEmailView(View): """Renders the...
1.867188
2
machine_learn2.py
agw2105/Natural-Language-Processing
1
12763003
<filename>machine_learn2.py import pandas as pd import nltk import sklearn from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.pipeline import Pipeline from sklearn.svm import Lin...
3.21875
3
build/lib/pyhamilton/interface.py
dgretton/pyhamilton
59
12763004
<gh_stars>10-100 import time, json, signal, os, requests, string, logging, subprocess, win32gui, win32con from http import server from threading import Thread from multiprocessing import Process from pyhamilton import OEM_RUN_EXE_PATH, OEM_HSL_PATH from .oemerr import * #TODO: specify from .defaultcmds import defaults_...
2.140625
2
rest.py
yjlou/simple-restful
2
12763005
<gh_stars>1-10 #!/usr/bin/python # # Access control, file/directory permission, authorization. # # TODO: # ~ for home of HTTP authenticator # DEBUG = 4 class Rest(): def __init__(self, db): self.db = db def can_access(self, user, path): """ If the user is permitted to access this directory ...
3.109375
3
ADoCSM/Automated_Documentation/UML_Diagram/Internal_Block_Diagram_Interface.py
ErnestoVivas/X-HD
2
12763006
<reponame>ErnestoVivas/X-HD from UML_Diagram import General from UML_Diagram import Object_Oriented_Relations from UML_Diagram import ClassDiagram from UML_Diagram import UML_Interface import os import shutil import numpy as np ClassConverter = General.Class_Converter() Realtion = Object_Oriented_Relations.Relation()...
2.4375
2
linode_core.py
pathbreak/linodecommon
0
12763007
import time import Queue import threading import collections import traceback import linode_api as lin import image_manager from passwordgen import pattern import simplejson as json import yaml import logger from exc import CreationError class Core(object): def __init__(self, app_ctx): assert app...
2.21875
2
sqllineage/core.py
surajpotnuru/sqllineage
0
12763008
<gh_stars>0 import re from typing import Set, TYPE_CHECKING, Tuple from sqlparse.sql import ( Comment, Comparison, Function, Identifier, IdentifierList, Parenthesis, Statement, TokenList, ) from sqlparse.tokens import Number from sqllineage.exceptions import SQLLineageException from sq...
2.5
2
python/PythonForNetworkEngineers/Examples/example1.py
ModestTG/scripts
0
12763009
# allows print() funtion and bytestrings to work in python2 from __future__ import print_function, unicode_literals my_str = 'whatever' ip_addr1 = '8.8.8.8' print(ip_addr1) try: ip_addr2 = raw_input("Enter an IP Address: ") # python2 input function except NameError: ip_addr2 = input("Enter an IP Address: ") ...
3.96875
4
notebook.py
ivddorrka/notebook
0
12763010
""" Notebook """ import datetime last_id = 0 class Note: def __init__(self, memo, tags=''): self.memo = memo self.tags = tags self.creation_date = datetime.date.today() global last_id last_id += 1 self.id = last_id def match(self, filter): return filter ...
3.421875
3
manager_core/tests/test_program_states.py
Junt0/CurbTheScreen
2
12763011
<reponame>Junt0/CurbTheScreen from unittest.mock import patch import pytest from manager_core.CurbTheScreen import TrackedProgram, Program, ProgramStates @pytest.fixture def states_fixture_full(states_fixture_empty, program_class_fixture): ps = states_fixture_empty program_arr = [] for program in progr...
2.265625
2
dcs/bin/scripts/parse_dcs_site.py
anoopsharma00/incubator-trafodion
0
12763012
# # @@@ START COPYRIGHT @@@ # #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.867188
2
examples/add_reference.py
jaideep-seth/PyOpenWorm
1
12763013
""" How to reference supporting evidence for some object in the database. See: "Metadata in PyOpenWorm" for discussion on semantics of what giving evidence for an object means. """ from __future__ import absolute_import from __future__ import print_function import PyOpenWorm as P from PyOpenWorm.evidence import Evide...
2.640625
3
psyrun/jobs.py
jgosmann/psyrun
2
12763014
<gh_stars>1-10 """Handling and processing of job trees.""" import itertools import os import os.path import warnings from psyrun.exceptions import JobsRunningWarning from psyrun.utils.doc import inherit_docs class Job(object): """Describes a single processing job. Parameters ---------- name : str ...
2.890625
3
integration-tests/test_hub.py
MayeulC/the-littlest-jupyterhub
0
12763015
<filename>integration-tests/test_hub.py<gh_stars>0 import requests from hubtraf.user import User from hubtraf.auth.dummy import login_dummy import secrets import pytest from functools import partial import asyncio import pwd import grp import sys import subprocess from tljh.normalize import generate_system_username #...
2.234375
2
tests/filter_tests/digits_test.py
projectshift/shift-validate
1
12763016
<reponame>projectshift/shift-validate<gh_stars>1-10 from unittest import TestCase, mock from nose.plugins.attrib import attr from shiftschema.filters import Digits @attr('filter', 'digits') class DigitsTest(TestCase): """ String digits filter test""" def test_create(self): """ Can create digits filt...
2.75
3
tools/simnet/preprocess/quora.py
deternan/AnyQ
1
12763017
<gh_stars>1-10 import os os.chdir('/tmp/AnyQ-master/tools/simnet/preprocess/') import pandas as pd import numpy as np import nltk from nltk.corpus import stopwords from nltk.stem import SnowballStemmer import re from string import punctuation import itertools from collections import defaultdict from gensim import ...
2.671875
3
tests/config.py
kajusK/HiddenPlaces
0
12763018
from app.config import Config class TestConfig(Config): TESTING = True SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:' SQLALCHEMY_ECHO = False WTF_CSRF_ENABLED = False
1.492188
1
takco/cluster/context.py
karmaresearch/takco
16
12763019
<gh_stars>10-100 import hashlib import logging as log import copy from takco import Table def tables_add_context_rows(tables, fields=()): """Add context to table depending on table dict fields""" for table in tables: table = Table(table).to_dict() for field in list(fields)[::-1]: ...
2.28125
2
consultantform/forms.py
rajeshgupta14/pathscriptfinal
0
12763020
<gh_stars>0 from django import forms from consultantform.models import Relatedcompany,Article,Backgroundcheck,Backgroundcheckb, Problemsolving, Problemsolvingp, Digitalization, Digitalizationp, Miom, Miomp, Duediligence, Script, Strategy,Duediligencep, Scriptp, Strategyp, Branch,Subsidiary from myapp.models import Proj...
1.875
2
src/q1102.py
mirzadm/ctci-5th-py
0
12763021
<reponame>mirzadm/ctci-5th-py<filename>src/q1102.py """Sort an array by anagram.""" def sort_by_anagram(array): n = len(array) if n <= 2: return array i = 0 while i < n-2: for j in range(i+1, n): if is_anagram(array[i], array[j]): i += 1 ...
3.640625
4
thefeck/rules/dirty_untar.py
eoinjordan/thefeck
0
12763022
<gh_stars>0 import tarfile import os from thefeck.utils import for_app from thefeck.shells import shell tar_extensions = ('.tar', '.tar.Z', '.tar.bz2', '.tar.gz', '.tar.lz', '.tar.lzma', '.tar.xz', '.taz', '.tb2', '.tbz', '.tbz2', '.tgz', '.tlz', '.txz', '.tz') def _is_tar_extrac...
2.375
2
mvpnet/evaluate_3d.py
shnhrtkyk/mvpnet
79
12763023
<filename>mvpnet/evaluate_3d.py import numpy as np from sklearn.metrics import confusion_matrix as CM CLASS_NAMES = ['wall', 'floor', 'cabinet', 'bed', 'chair', 'sofa', 'table', 'door', 'window', 'bookshelf', 'picture', 'counter', 'desk', 'curtain', 'refridgerator', 'showercurtain', 'toil...
2.609375
3
server/users/forms.py
NRshka/distconfig
0
12763024
from flask_wtf import FlaskForm from wtforms import TextField, PasswordField from wtforms.validators import DataRequired, Length, Email, EqualTo class LoginForm(FlaskForm): username = TextField("Login", validators=[DataRequired(), Length(min=6, max=20)]) password = PasswordField("Password", validators=...
3.03125
3
src/domain/component.py
gmdlba/simulation
0
12763025
class Component: def __init__(self, fail_ratio, repair_ratio, state): self.fail_ratio = fail_ratio self.repair_ratio = repair_ratio self.state = state
2.578125
3
setup.py
jason-ennis/runcloud-letsencrypt
77
12763026
from setuptools import setup setup(name='rcssl', version='1.5', description='Install Let\'s Encrypt SSL on RunCloud servers the easy way.', author="Rehmat", author_email="<EMAIL>", url="https://github.com/rehmatworks/runcloud-letsencrypt", license="MIT", entry_points={ 'console_scripts': [ 'rcssl = rcssl.r...
1.390625
1
WIN_FileProtectionSetting/OS_gathering/files/extracting.py
exastro-playbook-collection/OS-Windows2019
0
12763027
import re import json import sys import os args = sys.argv if (len(args) < 2): sys.exit(1) path = args[1] if(path[-1:] == "/"): path = path[:-1] result_filedata_list = [] count = 0 while True: # Decectory exist check dirpath = path + '/command/' + str(count) if os.path.isdir(dirpath): co...
2.796875
3
twitter.py
projeto7c0/7c0-tweets
10
12763028
<filename>twitter.py<gh_stars>1-10 import tweepy import twitter_auth import time from datetime import datetime def tweet(handle, tweet, archive_url, creation_date, idTweets, status): api = twitter_auth.autentica_tweets() status = api.update_status(in_reply_to_status_id = status.id, status = "O tweet com id " +...
3.03125
3
timezone.py
Vargynja/timezone-converter
1
12763029
#!/usr/bin/python # coding=utf-8 import sys import csv import datetime #run with python timezone.py 8.30 pdt eest # time timezone timezone-of-conversion def main(): # check if correct ammount of arguments doesnt work otherwise if len(sys.argv) != 4: print('Incorrect amount of arguments.') ...
3.59375
4
vega/core/__init__.py
wnov/vega
6
12763030
from .run import run, env_args, init_local_cluster_args from .backend_register import set_backend from zeus import is_gpu_device, is_npu_device, is_torch_backend, is_tf_backend, is_ms_backend from zeus.trainer import * # from .evaluator import * from zeus.common import FileOps, TaskOps, UserConfig, module_existed
1.125
1
custom1/custom1/report/item_summary/item_summary.py
jof2jc/custom1
0
12763031
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import msgprint, _ from frappe.utils import flt,cstr def execute(filters=None): if not filters: filters = {} item_map = {} ...
1.679688
2
Figures_tables/5_Fig3A_3B.py
jlanillos/clinAcc_PGx_WES
2
12763032
# Script wh helps to plot Figures 3A and 3B import matplotlib.pyplot as plt import pandas as pd import numpy as np # Include all GENES, those containing Indels and SNVS (that's why I repeat this step of loading "alleles" dataframe) This prevents badly groupping in 20210105_plotStacked...INDELS.py alleles = pd.read_csv...
2.40625
2
graphs/sequence_result_plot.py
kavinyao/SKBPR
0
12763033
from plot_common import output_graph # results of N = 5, 10, 15, 20 Ns = [5, 10, 15, 20] large_dataset_precisions = { 'SKBPR-BC': (Ns, [0.0366, 0.0297, 0.0263, 0.0244], [0.0004, 0.0003, 0.0002, 0.0002], [0.0002, 0.0003, 0.0003, 0.0003]), 'SKBPR-BC-SEQ': (Ns, [0.0363, 0.0293, 0.0260, 0.0241], [0.0001, 0.0002, ...
2.171875
2
cocojson/tools/insert_img_meta.py
TeyrCrimson/cocojson
0
12763034
<reponame>TeyrCrimson/cocojson ''' Insert any extra attributes/image meta information associated with the images into the coco json file. Input will be a paired list of image name (comma seperated) and meta-information, together with the attribute name For example: Paired List: img1.jpg,iphone ...
2.859375
3
1DNewtonianFreeFall.py
HenryBass/Python-Simulations
2
12763035
<reponame>HenryBass/Python-Simulations # Gravity Simulation import math import numpy as np # Welcome print("Welcome to a 1D Free Fall Simulation. Please enter only in metric integers. ") print("You will enter the amount of time you want to simulate, it includes information about impact, \n" "even if t...
4.03125
4
mods/Maze/main.py
SummitChen/opennero
215
12763036
# OpenNero will execute ModMain when this mod is loaded from Maze.client import ClientMain def ModMain(mode = ""): ClientMain(mode) def StartMe(): from Maze.module import getMod getMod().set_speedup(1.0) # full speed ahead getMod().start_sarsa() # start an algorithm for headless mode
2.09375
2
src/prefect/backend/__init__.py
gabrielvieira37/prefect
0
12763037
from prefect.backend.task_run import TaskRunView from prefect.backend.flow_run import FlowRunView, execute_flow_run from prefect.backend.flow import FlowView from prefect.backend.kv_store import set_key_value, get_key_value, delete_key, list_keys
1.226563
1
kunquat/tracker/ui/views/utils.py
kagu/kunquat
13
12763038
# -*- coding: utf-8 -*- # # Author: <NAME>, Finland 2015-2020 # # This file is part of Kunquat. # # CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ # # To the extent possible under law, Kunquat Affirmers have waived all # copyright and related or neighboring rights to Kunquat. # from kunquat.trac...
1.867188
2
src/org_to_anki/ankiClasses/AnkiDeck.py
Leodore59/org_to_anki
65
12763039
from .AnkiQuestion import AnkiQuestion # from .AnkiQuestionMedia import AnkiQuestionMedia class AnkiDeck: # Basic file => represented in a single deck # MultiDeck file => File will have multiple subdecks of general topic # represented by file def __init__(self, name): # (str) self.deckName = n...
2.875
3
tests/arch/arm/translators/test_branch.py
IMULMUL/barf-project
1,395
12763040
<reponame>IMULMUL/barf-project # Copyright (c) 2019, Fundacion Dr. <NAME> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice...
1.570313
2
Push2/bank_selection_component.py
phatblat/AbletonLiveMIDIRemoteScripts
4
12763041
# Source Generated with Decompyle++ # File: bank_selection_component.pyc (Python 2.5) from __future__ import absolute_import from ableton.v2.base import NamedTuple, listenable_property, listens, listens_group, liveobj_valid, SlotManager, nop from ableton.v2.control_surface import Component from ableton.v2.control_surf...
2.34375
2
blog/app.py
jancr/blog
1
12763042
<reponame>jancr/blog<filename>blog/app.py<gh_stars>1-10 # core imports import argparse # 3rd party imports from flask import Flask # local imports from views import bp from models import Entry, FTSEntry, db import config def parse_args(): parser = argparse.ArgumentParser() parser.add_arg...
2.203125
2
model/event_pairs_with_particle_obj.py
wenlinyao/RegularTemporalEventPairs
1
12763043
<filename>model/event_pairs_with_particle_obj.py # this program is going to find verb word's particle and object to make each event pair more precise from StringIO import StringIO from sets import Set import glob import timeit import gc import gzip import re #----------------------------------------------------------...
2.65625
3
lucy/kvmemnn.py
nemanja-m/key-value-memory-network
9
12763044
import torch from torch.nn import Module, Linear, Softmax, CosineSimilarity, Embedding class KeyValueMemoryNet(Module): """Defines PyTorch model for Key-Value Memory Network. Key-Value Memory Networks (KV-MemNN) are described here: https://arxiv.org/pdf/1606.03126.pdf Goal is to read correct response fr...
3.71875
4
scripts/preprocessing/enumerate_dir.py
trirop/Kayakcounter
2
12763045
import os # Function to rename multiple files def main(): i = 252 path="/home/tristan/Bilder/Temp2/" for filename in os.listdir(path): print(filename) if "JPG" in filename: print(filename) my_dest =str(i) + ".jpg" my_source =path + filename my_dest =path +...
3.609375
4
paramgenerator/timeparameters.py
hubertsuprunowicz/ldbc_snb_datagen
0
12763046
<reponame>hubertsuprunowicz/ldbc_snb_datagen #!/usr/bin/env python3 import sys LAST_MONTHS = 3 # number of months that we consider for date parameters in the filters of a form timestamp <= Date0 START_YEAR = 2010 # default value that gets over-written from the data generator output class MonthYearCount: def __init_...
2.890625
3
sauronlib/audio_handler.py
dmyersturnbull/sauronlib
0
12763047
import platform, typing from typing import Optional from klgists.common.exceptions import ExternalCommandFailed from klgists.files.wrap_cmd_call import wrap_cmd_call from sauronlib import logger from sauronlib.audio_info import AudioInfo class CouldNotConfigureOsAudioError(IOError): def description(self): return...
2.375
2
magnum/conductor/handlers/k8s_conductor.py
ISCAS-VDI/magnum-base
0
12763048
<gh_stars>0 # 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, soft...
1.851563
2
lib/pavilion/var_dict.py
lanl-preteam/pavilion2-tmp
1
12763049
from collections import UserDict from functools import wraps import logging def var_method(func): """This decorator marks the given function as a scheduler variable. The function must take no arguments (other than self).""" # pylint: disable=W0212 # The scheduler plugin class will search for these. ...
3.34375
3
src/spaceone/notification/manager/__init__.py
jihyungSong/plugin-email-notification-protocol
0
12763050
<reponame>jihyungSong/plugin-email-notification-protocol from spaceone.notification.manager.notification_manager import NotificationManager from spaceone.notification.manager.smtp_manager import SMTPManager
1.046875
1