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 |
|---|---|---|---|---|---|---|
uoftscrapers/scrapers/buildings/__init__.py | kshvmdn/uoft-scrapers | 49 | 12797151 | <filename>uoftscrapers/scrapers/buildings/__init__.py
from ..utils import Scraper, LayersScraper
from bs4 import BeautifulSoup
from collections import OrderedDict
from decimal import *
import os
import re
class Buildings:
"""A scraper for UofT's buildings.
UofT Map is located at http://map.utoronto.ca/.
... | 3.046875 | 3 |
character/models/__init__.py | SamusChief/myth-caster-api | 0 | 12797152 | <gh_stars>0
""" Models for Characters """
from .ancestry import Ancestry, SubAncestry
from .background import Background
from .character import Character, ClassAndLevel, InventoryAdventuringGear, \
InventoryArmor, InventoryTool, InventoryWeapon, InventoryWondrousItem, SkillProficiency
from .character_class import C... | 1.023438 | 1 |
i3-wm/myScript/files/get-schedule-text.py | Mirasire/dotfiles | 5 | 12797153 | <reponame>Mirasire/dotfiles
#!/bin/python
#feature: html -> text
#reglex
import re
#import BeautifulSoup
from bs4 import BeautifulSoup
def sigleOrDoubel(str0):
num=2;
if str0.find('单')!=-1:
num=1
elif str0.find('每')!=-1:
num=0
return num
if __name__ == "__main__":
#dealwith the p... | 2.84375 | 3 |
src/tools/ncbi/ncbi_entrez_download_fasta.py | uct-cbio/galaxy-tools | 0 | 12797154 | <gh_stars>0
#!/usr/bin/python
# Retrieve FASTA sequence from NCBI based on an Entrez query.
# to start a new download
# entrez_download_fasta.py -m <EMAIL> -d nucleotide -e "Cypripedioideae[Orgn] AND matK[Gene]" -f out.fasta -i download_info.txt
# to continue a previous download
# entrez_download_fasta.py -m <EMAIL>... | 2.71875 | 3 |
__init__.py | karttur/geoimagine02-ancillary | 0 | 12797155 | """
ancillary
==========================================
Package belonging to Karttur´s GeoImagine Framework.
Author
------
<NAME> (<EMAIL>)
"""
from .version import __version__, VERSION, metadataD
from .ancillary import ProcessAncillary
from .searchjson import SearchJsonTandemX, UnZipJsonTandemX
__all__ = ['Pro... | 0.96875 | 1 |
examples/fractal.py | Lnk2past/copperhead | 12 | 12797156 | <filename>examples/fractal.py
import sys
import copperhead as cpp
extra_compile_args = "'/std:c++14'" if sys.version.split('[')[1].startswith('MSC') else "'-std=c++14'"
config = {
'extra_compile_args': extra_compile_args
}
mandelbrot_cpp = r'''
#include <cmath>
#include <complex>
#include <fstream>
inline int m... | 2.859375 | 3 |
src/data_analysis/background_subtractors.py | otimgren/centrex-data-analysis | 0 | 12797157 | """
Objects used for subtracting background from camera images
"""
from abc import ABC, abstractmethod
from dataclasses import dataclass
import numpy as np
import pandas as pd
class BackgroundSubtractor:
"""
Subtracts background from an image
"""
@abstractmethod
def subtract_background(self, ima... | 3.5 | 4 |
bokeh/plotting.py | csaid/bokeh | 1 | 12797158 | <reponame>csaid/bokeh
from __future__ import print_function
from functools import wraps
import itertools
import time
import logging
import os
import uuid
import warnings
from . import browserlib
from . import _glyph_functions as gf
from .document import Document
from .embed import notebook_div, file_html, autoload_se... | 2.671875 | 3 |
auton_survival/__init__.py | PotosnakW/auton-survival | 15 | 12797159 | <reponame>PotosnakW/auton-survival
r'''
[](https://travis-ci.org/autonlab/DeepSurvivalMachines)
[](http... | 1.367188 | 1 |
src/packModules/filewrite.py | PauloHenriqueRCS/InterPy | 0 | 12797160 | <filename>src/packModules/filewrite.py
def filewrite(outcontent,filename):
try:
filecontent = open("outFiles/outcontent.txt", mode="a", encoding="utf-8")
filecontent.write("\n\n\n=========={}==========\n".format(filename))
filecontent.write("\n".join(str(el) for el in outcontent))
except... | 3.203125 | 3 |
api/models.py | szczesnymateo/words-world-api | 0 | 12797161 | from fractions import Fraction
from django.db import models
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
@receiver(post_save, sender=User)
def create_blank_statistics(sender, instance=None, created=False, **kwargs):
if created:
... | 2.09375 | 2 |
heterocl/compute_api.py | Kins1ley/tvm | 0 | 12797162 | <filename>heterocl/compute_api.py
"""Compute APIs in HeteroCL"""
#pylint: disable=no-member, redefined-builtin, too-many-arguments, missing-docstring
import numbers
from collections import OrderedDict
from tvm import expr_hcl as _expr, stmt as _stmt
from tvm.tir import IterVar as _IterVar
from util import get_index, ge... | 2.1875 | 2 |
build/lib/Kronos_heureka_code/Zeit/Uhrzeit/Stunde/Stunde.py | heureka-code/Kronos-heureka-code | 0 | 12797163 | from Kronos_heureka_code.__VergleichsStamm import VergleichsStammZahl
from Kronos_heureka_code.Zeit.Uhrzeit.Stunde.StundeException import *
class Stunde(VergleichsStammZahl):
def __init__(self, stunde: int):
self.__stunde: [int, None] = None
self.stunde = stunde
pass
def __repr__(self... | 2.453125 | 2 |
toolcall/auth_backend.py | thebjorn/toolcall | 0 | 12797164 | <gh_stars>0
# -*- coding: utf-8 -*-
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
class DKSSOBlindTrustAuthenticator(ModelBackend):
def authenticate(self, username=None, password=<PASSWORD>, **kw):
if not kw.get('sso_login'):
return None
... | 2.140625 | 2 |
src/modules/single.py | szachovy/MLstats | 1 | 12797165 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy
from statsmodels import robust
class Singular_description(object):
'''
Display statistics from every numerical column in data set.
Base class for Mutual description instance.
Outcomes are repre... | 3.078125 | 3 |
paragraph_encoder/train_para_encoder.py | rajarshd/Multi-Step-Reasoning | 122 | 12797166 | <filename>paragraph_encoder/train_para_encoder.py
import torch
import numpy as np
import json
import os
import pickle
import sys
import logging
import shutil
from tqdm import tqdm
from torch.autograd import Variable
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data.sampler import Random... | 2.375 | 2 |
PRS/PRS_extract_phenotypes.py | yochaiedlitz/T2DM_UKB_predictions | 1 | 12797167 | <reponame>yochaiedlitz/T2DM_UKB_predictions
import pandas
import os
import numpy as np
import sys
from pysnptools.snpreader.bed import Bed
import subprocess
cleanDataPath='/net/mraid08/export/jafar/Microbiome/Analyses/PNPChip/cleanData/'
rawDataPath='/net/mraid08/export/jafar/Microbiome/Analyses/PNPChip/rawData'
pheno_... | 2.015625 | 2 |
ebel/validate.py | e-bel/ebel | 1 | 12797168 | <filename>ebel/validate.py
"""Collect of methods used for validating a BEL file."""
import os
import re
import csv
import difflib
import logging
from typing import Iterable, Union, Optional
from textwrap import fill
import numpy as np
import pandas as pd
import ebel.database
from ebel.parser import check_bel_script_... | 2.796875 | 3 |
pipestat/const.py | pepkit/pipestat | 1 | 12797169 | import os
from sqlalchemy.dialects.postgresql.json import JSONB
from sqlalchemy.types import ARRAY, JSON, Boolean, Float, Integer, String
PKG_NAME = "pipestat"
LOCK_PREFIX = "lock."
REPORT_CMD = "report"
INSPECT_CMD = "inspect"
REMOVE_CMD = "remove"
RETRIEVE_CMD = "retrieve"
STATUS_CMD = "status"
SUBPARSER_MSGS = {
... | 2.359375 | 2 |
src/server/endpoints/__init__.py | lee14257/delphi-epidata | 0 | 12797170 | from . import (
afhsb,
cdc,
covid_hosp_facility_lookup,
covid_hosp_facility,
covid_hosp_state_timeseries,
covidcast_nowcast,
covidcast_meta,
covidcast,
delphi,
dengue_nowcast,
dengue_sensors,
ecdc_ili,
flusurv,
fluview_clinicial,
fluview_meta,
fluview,
... | 1.070313 | 1 |
fwla-center-folder.py | FWLA/fwla-center-folder | 0 | 12797171 | import logging
import random
import requests
import board
import neopixel
import smbus2
from apscheduler.schedulers.blocking import BlockingScheduler
class LedController:
def reset(self):
pass
def set(self, id):
pass
class LoggingLedController(LedController):
def reset(self):
l... | 2.640625 | 3 |
dolfyn/test/test_read_adp.py | aidanbharath/dolfyn | 0 | 12797172 | <reponame>aidanbharath/dolfyn
from dolfyn.main import read_example as read
import dolfyn.test.base as tb
import sys
load = tb.load_tdata
save = tb.save_tdata
dat_rdi = load('RDI_test01.h5')
dat_rdi_i = load('RDI_test01_rotate_beam2inst.h5')
dat_awac = load('AWAC_test01.h5')
dat_awac_ud = load('AWAC_test01_ud.h5')
dat... | 2.265625 | 2 |
api/hpcpm/api/resources/endpoints/nodes/computation_node/SoftLimit.py | tomix86/hpcpm | 2 | 12797173 | from flask_restful import Resource, request, abort
from flask_restful_swagger import swagger
from hpcpm.api import log
from hpcpm.api.helpers.database import database
from hpcpm.api.helpers.utils import abort_when_not_int, abort_when_node_not_found
from hpcpm.api.helpers.constants import COMPUTATION_NODE_PARAM_NAME, C... | 2.328125 | 2 |
orchestra/tests/workflows/test_dir/load_sample_data.py | code-review-doctor/orchestra | 444 | 12797174 | <reponame>code-review-doctor/orchestra
def load(workflow_version):
""" Dummy loading function. """
pass
| 1.039063 | 1 |
deepfake_multiple.py | andyboyad/first-order-model | 0 | 12797175 | import imageio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from skimage.transform import resize
from IPython.display import HTML
import warnings
import sys
import os
from demo import load_checkpoints
from demo import make_animation
from skimage import img_as_ubyte
warnin... | 2.28125 | 2 |
integreat_cms/api/v3/events.py | Integreat/cms-v2 | 21 | 12797176 | <reponame>Integreat/cms-v2
"""
This module includes functions related to the event API endpoint.
"""
from copy import deepcopy
from datetime import timedelta
from django.conf import settings
from django.http import JsonResponse
from django.utils import timezone
from django.utils.html import strip_tags
from ...cms.m... | 2.34375 | 2 |
groupon_data.py | AndrewSLowe/yipitdata | 1 | 12797177 | import pandas as pd
file_name = r'/Users/andrewlowe/yipitdata/Q4_2013_Groupon_North_America_Data_XLSX.xlsx'
df = pd.read_excel(file_name)
# Q4_13_NA dataframe
Q4_13_NA = df
# (138534, 7) There are 138534 items in the dataframe.
Q4_13_NA.shape
Q4_13_NA.describe()
Q4_13_NA.describe(exclude='number')
Q4_13_NA[]
se... | 2.78125 | 3 |
codes/synthetic.py | facebookresearch/metamulti | 1 | 12797178 | <reponame>facebookresearch/metamulti
#!/usr/bin/env python3
"""
Plot the subpopulation deviations for a range of synthetic toy examples.
Copyright (c) Meta Platforms, Inc. and affiliates.
This script creates a directory, "unweighted", in the working directory if the
directory does not already exist, then creates man... | 2.9375 | 3 |
tests/unit/agent/test_remote_agent.py | DEX-Company/ocean-py | 0 | 12797179 | <filename>tests/unit/agent/test_remote_agent.py
"""
Test RemoteAgent Unit
"""
import pytest
import requests
import secrets
from starfish.agent.remote_agent import RemoteAgent
from starfish.exceptions import StarfishConnectionError
from starfish.middleware.agent.remote_agent_adapter import RemoteAgentAdapter
fr... | 2.296875 | 2 |
examples/typical_script.py | Zulko/pompei | 46 | 12797180 | <reponame>Zulko/pompei
"""
This is a typical script to reconstruct one frame of a movie using a mosaic
of other frames with the Python package Pompei. It generates this picture of
general Maximus in Gladiator using 1100+ frames of the movie.
http://i.imgur.com/Eoglcof.jpg
This script goes in five steps:
1. Extract o... | 3.359375 | 3 |
DataGrooming/maf2vcf.py | rschenck/DPhilRotation1Part2 | 1 | 12797181 | '''
Script to convert a MAF to a vcf4.2 file using python >=3.6.
Created by <NAME>
8 March 2018
'''
import os
import sys
from optparse import OptionParser
import subprocess
from functools import wraps
import datetime
import time
import numpy as np
def OptionParsing():
usage = 'usage: %prog -i <*.maf> -o <director... | 2.75 | 3 |
make_cfg.py | kangwonlee/reposetman | 0 | 12797182 | <gh_stars>0
cfg_template = r"""[18pfd_{i:02d}]
list = 18pfd_wk{i:02d}.txt
folder = repository\wk{i:02d}
count_commits = True
run_all = True
pound_count = True
after = 2018-08-27 12:52
"""
for i in range(5, 10+1):
if 8 != i:
print(cfg_template.format(**{'i': i}))
| 2.1875 | 2 |
test/test_finalize.py | sbacchio/tuneit | 0 | 12797183 | from tuneit.graph import visualize
from tuneit.tunable import *
from tuneit.variable import *
from tuneit.tunable import Tunable
from tuneit.finalize import finalize
from pytest import raises
def test_finalize():
with raises(TypeError):
finalize(1)
a = variable(range(10), default=2)
assert final... | 2.234375 | 2 |
etoLib/etoLib/Attic/s3_func.py | tonybutzer/eto-draft | 0 | 12797184 | <gh_stars>0
def s3_hello(person_name):
print('Hello There Person:', person_name)
def s3_push_delete_local(local_file, bucket, bucket_filepath):
print('def s3_push_delete_local(local_file, bucket, bucket_filepath):')
| 2.078125 | 2 |
openmdao/utils/tests/test_options_dictionary_feature.py | hwangjt/blue | 0 | 12797185 | <filename>openmdao/utils/tests/test_options_dictionary_feature.py
from openmdao.api import OptionsDictionary, ExplicitComponent
import unittest
from six import PY3, assertRegex
import numpy as np
from openmdao.devtools.testutil import assert_rel_error
class VectorDoublingComp(ExplicitComponent):
def initialize(s... | 2.265625 | 2 |
azure_monitor/examples/metrics/standard.py | yao-cqc/opentelemetry-azure-monitor-python | 13 | 12797186 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# pylint: disable=import-error
# pylint: disable=no-member
# pylint: disable=no-name-in-module
import time
import requests
from opentelemetry import metrics
from opentelemetry.instrumentation.requests import RequestsInstrumen... | 2.296875 | 2 |
python/fabric/fabfile.py | cuongnb14/cookbook | 0 | 12797187 | """
Fabfile template for python3
"""
# -*- coding: utf-8 -*-
from __future__ import print_function
from slackclient import SlackClient
from fabric.api import cd, env, task, run, settings, local
from fabfile_config import *
import traceback
from fabric.contrib.files import exists
LAST_CID_FILE = "last_commit_id.txt"
... | 2.109375 | 2 |
worker/ttypes.py | apioo/fusio-worker-python | 0 | 12797188 | <filename>worker/ttypes.py
#
# Autogenerated by Thrift Compiler (0.14.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
... | 2.046875 | 2 |
monotonic_gru.py | arghosh/MNSS | 1 | 12797189 | import torch
import torch.nn as nn
import math
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class MonotonicGruCell(nn.Module):
def __init__(self, input_size, hidden_size, bias=True):
super().__init__()
"""
For each element in the input sequence, each layer compute... | 2.875 | 3 |
tests/app/signals.py | systemallica/django-snitch | 16 | 12797190 | <gh_stars>10-100
import datetime
from django.db.models.signals import post_save
from django.dispatch import receiver
from django_celery_beat.models import DAYS
from snitch.schedules.models import Schedule
from tests.app.events import DUMMY_EVENT, EVERY_HOUR
from tests.app.models import OtherStuff
@receiver(post_sav... | 2.234375 | 2 |
Editor/Noriter/Noriter/UI/SideWindow.py | RangHo/pini-engine | 0 | 12797191 | <filename>Editor/Noriter/Noriter/UI/SideWindow.py
from PySide import QtCore,QtGui
from Noriter.UI.Layout import *
from Noriter.UI import NoriterWindow as nWin
class SideWindow (nWin.NoriterWindow, QtGui.QWidget):
def __init__(self):
super(SideWindow, self).__init__()
self.setContextMenuPolicy(QtCore.Qt.CustomCon... | 1.78125 | 2 |
addons/mrp_byproduct/wizard/change_production_qty.py | jjiege/odoo | 0 | 12797192 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class ChangeProductionQty(models.TransientModel):
_inherit = 'change.production.qty'
@api.model
def _update_product_to_produce(self, prod, qty, old_qty):
modification =... | 2.03125 | 2 |
ife/features/tests/test_colourfulness.py | Collonville/ImageFeatureExtractor | 2 | 12797193 | <filename>ife/features/tests/test_colourfulness.py
import unittest
class TestColoufulness(unittest.TestCase):
def test_colourfulness(self) -> None:
pass
| 1.40625 | 1 |
src/data_utils.py | lrgr/sigma | 14 | 12797194 | import numpy as np
from pomegranate import *
import json
################################################################################
# LOGGING
################################################################################
import logging
# Logging format
FORMAT = '%(asctime)s SigMa %(levelname)-10s: %(message)s... | 2.171875 | 2 |
a.py | kavindu23110/groupproject | 0 | 12797195 | import serial
import time
import sys,ast
message='';
c=' '.join(sys.argv[1:])
num=c.replace("[","").replace("]","").split(",")
message=num.pop()
class TextMessage:
# def __init__(self):
# self.recipient = recipient
# self.content = message
def connectPhone(... | 2.78125 | 3 |
service.py | ramrathi/baritone | 3 | 12797196 | from flask import Flask
import baritone
import json
app = Flask(__name__)
@app.route('/')
def hello():
print("Hello from terminal")
return "Hello world"
@app.route('/youtube/<link>')
def youtube(link):
print("ENTERED")
url = 'https://www.youtube.com/watch?v='+link
print(url)
result,status = (baritone.pipel... | 2.5625 | 3 |
test/unit/models/rulesets.py | sumanshil/pagerduty-api-python-client | 0 | 12797197 | <gh_stars>0
# Copyright (c) PagerDuty.
# See LICENSE for details.
import json
import unittest
import os.path
import requests_mock
from pypd import Rulesets
class IntegrationTestCase(unittest.TestCase):
def setUp(self):
self.base_url = 'https://api.pagerduty.com'
self.api_key = 'FAUX_API_KEY'
... | 2.25 | 2 |
ievv_auth/ievv_api_key/apps.py | appressoas/ievv_auth | 0 | 12797198 | <reponame>appressoas/ievv_auth
from django.apps import AppConfig
class IevvApiKeyConfig(AppConfig):
name = 'ievv_auth.ievv_api_key'
| 1.242188 | 1 |
pylon/aws/_bases.py | ch41rmn/pylon-oss | 3 | 12797199 | <reponame>ch41rmn/pylon-oss
"""Some base classes for AWS"""
class BaseMixin:
def __init__(self, name: str):
self.name = name
def __repr__(self):
return '<{module}.{cls} {name}>'.format(
module=self.__class__.__module__,
cls=self.__class__.__name__,
name=self... | 2.03125 | 2 |
03-DataWranglingWithMongoDB/P02-WrangleOpenStreetMapData/handler.py | ccampguilhem/Udacity-DataAnalyst | 1 | 12797200 | <gh_stars>1-10
import xml.sax
from collections import Counter, defaultdict
"""
Custom handler for parsing OpenStreetMap XML files.
While parsing the XML file, handler keeps trace of:
- tags count
- tags ancestors
It is possible to register callback functions for start or end events.
The callbacks for start event wi... | 3.15625 | 3 |
da-assistant/stack_build.py | nc6/daml | 0 | 12797201 | #!/usr/bin/env python3
# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from subprocess import call, STDOUT
from shutil import copyfile
import sys
import os
import fileinput
ORIGINAL_FIX_VERSION_HS = "gen-source/Version.hs.template... | 1.960938 | 2 |
carrus.py | caos21/Grodi | 2 | 12797202 | <reponame>caos21/Grodi
# Copyright 2019 <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... | 1.757813 | 2 |
doc/helloworld/src/helloworld/app.py | ukris/typhoonae.buildout | 0 | 12797203 | <gh_stars>0
# -*- coding: utf-8 -*-
#
# Copyright 2009 <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 applica... | 2.40625 | 2 |
pygipo/management/commands/__init__.py | felixhummel/pygipo | 0 | 12797204 | # vim: set fileencoding=utf-8 filetype=python :
import logging
log = logging.getLogger(__name__) | 1.382813 | 1 |
__init__.py | halibot-extra/mastermind | 0 | 12797205 | <gh_stars>0
from .mastermind import MastermindModule
Default = MastermindModule
| 1.148438 | 1 |
0557_reverse_words_in_a_string_III.py | hotternative/leetcode | 0 | 12797206 | """
Given a string s, reverse the order of characters in each word within a sentence
while still preserving whitespace and initial word order.
1 <= s.length <= 5 * 10**4
s contains printable ASCII characters.
s does not contain any leading or trailing spaces.
There is at least one word in s.
All the words in s are sep... | 3.84375 | 4 |
stelspec/core.py | behrouzz/stelspec | 0 | 12797207 | <filename>stelspec/core.py
"""
Module core
===========
This module retrieves data from ELODIE/SOPHIE archive. It has two classes,
Elodie and Sophie, both could be constructed by passing an object name.
Help on Elodie FITS files:
http://atlas.obs-hp.fr/elodie/500/download.html
Help on Sophie FITS files:
http://atlas.o... | 2.734375 | 3 |
ondewo/survey/survey_pb2_grpc.py | ondewo/ondewo-survey-client-python | 0 | 12797208 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from ondewo.survey import survey_pb2 as ondewo_dot_survey_dot_survey__pb2
class Sur... | 1.859375 | 2 |
sqpyte/opcode.py | hpi-swa-lab/SQPyte | 3 | 12797209 | from rpython.rlib.unroll import unrolling_iterable
dual_implementation_opcodes = [
'Add_Subtract_Multiply_Divide_Remainder',
'AggFinal',
'AggStep',
'Affinity',
'Cast',
'CollSeq',
'Compare',
'Copy',
'EndCoroutine',
'Function',
'Gosub',
'Goto',
'IdxLE_IdxGT_IdxLT_IdxGE... | 2.25 | 2 |
src/cities.py | codefortallahassee/TEMP_REST_API_Cities | 0 | 12797210 | <filename>src/cities.py
# requires
# pip install airtable
# pip install airtable-python-wrapper
import json
import airtable
from airtable import Airtable
key_File = open("../resources/key")
BASE_ID = keyFile.readline().rstrip() # found in url of API documentation for table
CITIES_TABLE = "USCities"
def create_cit... | 3.171875 | 3 |
newsdb_report/newsdb.py | stricklandrw/udacity-ipnd | 0 | 12797211 | <gh_stars>0
#!/usr/bin/env python
"""Database article and errors report generator."""
import datetime
import psycopg2
import bleach
DBNAME = "news"
TOP_ARTICLES = "3"
def get_article_counts(parameters):
"""Return all posts from the 'database', most recent first."""
"""Open PostGRES database session and retur... | 3.21875 | 3 |
control/init.py | KentStateRobotics/Robot_Control | 0 | 12797212 | <filename>control/init.py
#Kent State Univeristy - RMC team
#<NAME> 2018
#
#Starts program
import control
SOCK_PORT = 4242
HTTP_PORT = 80
robotContoler = control.control(HTTP_PORT, SOCK_PORT)
| 1.796875 | 2 |
herokuexample/run_glm.py | baogorek/HerokuExample | 0 | 12797213 | import os
import datetime
import psycopg2
import numpy as np
import pandas as pd
#import statsmodels.api as sm
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.genmod.families import Binomial
from statsmodels.genmod.families.links import probit
DATABASE_URL = os.environ['DATABASE_URL']
... | 2.453125 | 2 |
quadpy/e3r/_stroud_secrest.py | whzup/quadpy | 0 | 12797214 | import numpy
from sympy import Rational as frac
from sympy import pi, sqrt
from ..helpers import article, fsd, pm, pm_roll, untangle
from ._helpers import E3rScheme
citation = article(
authors=["<NAME>", "<NAME>"],
title="Approximate integration formulas for certain spherically symmetric regions",
journal... | 2.4375 | 2 |
src/filter_structs.py | mimirblockchainsolutions/w3aio | 3 | 12797215 | <gh_stars>1-10
from .types import Types
import logging
log = logging.getLogger(__name__)
"""
{
"addressFilter":<address> OPTIONAL,
"bnFilter":<uint256> OPTIONAL,
"abiFilters": OPTIONAL
[
{
name STRING REQUIRED
rvalue HEXSTR OR INT REQUIRED
type STRING REQUIRED
... | 2.46875 | 2 |
update_dd.py | alanmitchell/update-degree-days | 0 | 12797216 | <reponame>alanmitchell/update-degree-days<gh_stars>0
#!/usr/local/bin/python3.6
"""Script that adds monthly heating degree day values to a pickled
Pandas DataFrame with the path 'data/degree_days.pkl' (compression = 'bz2').
It also saves the DataFrame as a CSV file at 'data/degree_days.csv'. The
new degree-day informa... | 3.359375 | 3 |
src/Negamax.py | jrinder42/Checkers-AI | 0 | 12797217 | <filename>src/Negamax.py
from copy import deepcopy
import cPickle
from Board import Actions
class Negamax_AB(Actions):
BEST_MOVE = None
def __init__(self):
Actions.__init__(self)
def __deepcopy__(self, memodict={}): # faster than built-in
g = cPickle.loads(cPickle.dumps(self, -1))
... | 2.9375 | 3 |
leetcode_python/Heap/ugly-number-ii.py | yennanliu/CS_basics | 18 | 12797218 | # V0
# V1
# https://blog.csdn.net/coder_orz/article/details/51317748
# IDEA : "unly number" : a number is an ugly number
# if all its prime factors are within [2, 3, 5].
# e.g. 6, 8 are ugly number ; while 14 is not
# please note that 1 is ugly number as well
# IDEA : ITERATION
class Solution(object):
def ... | 4 | 4 |
bin/reverse-geocode.py | straup/buildingequalsyes | 1 | 12797219 | #!/usr/bin/env python
import sys
import shapely
import sqlite3
import urllib2
import json
import time
import reverse_geoplanet
from shapely.geometry import Polygon
from shapely.geometry import LineString
def munge(path, reversegeo_endpoint) :
#
rg = reverse_geoplanet.reverse_geoplanet(reversegeo_en... | 2.71875 | 3 |
workflow/src/crawler.py | showyou/docker-chatbot-niko | 0 | 12797220 | <filename>workflow/src/crawler.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import json
import datetime
from sqlalchemy import and_
import random
# /home/*/hama_dbとかが返ってくる
#exec_path = os.path.abspath(os.path.dirname(__file__)).rsplit("/",1)[0]
exec_path = "."
conf_path = exec_path+"/common... | 2.421875 | 2 |
scripts/upload_questions.py | thecrux4020/telegram-bot | 9 | 12797221 | import boto3
from boto3.dynamodb.types import TypeDeserializer, TypeSerializer
import json
import logging
DYNAMODB_TABLE_NAME = "quizzes_questions"
def setup_logging():
""" Basic logging setup """
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
... | 2.453125 | 2 |
assignment1/cs231n/classifiers/linear_svm.py | ivanistheone/cs231n | 1 | 12797222 | <gh_stars>1-10
from builtins import range
import numpy as np
from random import shuffle
from past.builtins import xrange
def svm_loss_naive(W, X, y, reg):
"""
Structured SVM loss function, naive implementation (with loops).
Inputs have dimension D, there are C classes, and we operate on minibatches
of... | 3.140625 | 3 |
turq/examples.py | XiaoboHe/turq | 45 | 12797223 | import pkgutil
import xml.etree.ElementTree
import docutils.core
def load_pairs():
# Load pairs of "example ID, rules code" for the test suite.
rst_code = _load_rst()
xml_code = docutils.core.publish_string(rst_code, writer_name='xml')
tree = xml.etree.ElementTree.fromstring(xml_code)
parsed = []... | 2.3125 | 2 |
easy/python3/c0050_204_count-primes/00_leetcode_0050.py | drunkwater/leetcode | 0 | 12797224 | <gh_stars>0
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#204. Count Primes
#Description:
#Count the number of prime numbers less than a non-negative number, n.
#Credits:
#Special thanks to @mithmatt... | 3.09375 | 3 |
forum/migrations/0001_initial.py | ghcis/forum | 0 | 12797225 | # Generated by Django 3.2.7 on 2021-09-11 13:54
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 1.828125 | 2 |
src/EcmsApi/tables/_base.py | Poseidon-Dev/ecms-api | 0 | 12797226 | <reponame>Poseidon-Dev/ecms-api<filename>src/EcmsApi/tables/_base.py
import os
__all__ = ['TableMixin']
class TableMixin:
"""
Table Mixin class to get quick properties from the table
"""
NAMESPACE = os.getenv('ECMS_HOST')
FORIEGN_KEYS = {}
def __init__(self):
self.TABLE = self.__clas... | 2.1875 | 2 |
Hashtable/1124. Longest Well-Performing Interval.py | viewv/leetcode | 2 | 12797227 | class Solution:
def longestWPI(self, hours: List[int]) -> int:
res = dict()
s = 0
ans = 0
for i, c in enumerate(hours):
s += 1 if c > 8 else -1
if s > 0:
ans = i + 1
if s not in res:
res[s] = i
if s - 1 i... | 2.875 | 3 |
pymyenergi/ct.py | CJNE/pymyenergi | 5 | 12797228 | <reponame>CJNE/pymyenergi
class CT:
def __init__(self, name, value) -> None:
self._name = name
self._value = value
@property
def name(self):
"""Name of CT clamp"""
return self._name
@property
def power(self):
"""Power reading of CT clamp in W"""
retu... | 2.59375 | 3 |
ch5/exercises/ans5_6.py | chunhua2017/pythonprogrammingdemo | 4 | 12797229 | # 先确认在VSCode的Settings中,勾选“Terminal:Excute In File Dir”
# 在当前文件夹下将hello_world.txt文件复制为hello_world_bak.txt
src = r'hello_world.txt'
dst = r'hello_world_bak.txt'
import shutil
shutil.copyfile(src, dst) | 1.929688 | 2 |
apps/vehicle_counting/worker/worker.py | microsoft/nxs | 5 | 12797230 | <filename>apps/vehicle_counting/worker/worker.py
import os
import cv2
from nxs_libs.db import NxsDbFactory, NxsDbType
from apps.vehicle_counting.app_types.app_request import (
InDbTrackingAppRequest,
RequestStatus,
)
from apps.vehicle_counting.worker.utils import *
DB_TASKS_COLLECTION_NAME = "tasks"
DB_COUNTS... | 2.28125 | 2 |
pyadlml/plot/feature_importance.py | tcsvn/pyadlml | 4 | 12797231 | class FeatureImportance(object):
def __init__(self, md, test_x, test_z):
self._skater_model, self._skater_interpreter = _create_skater_stuff(md, test_x, test_z)
def save_plot_feature_importance(self, file_path):
fig, ax = self._skater_interpreter.feature_importance.plot_feature_importance(
... | 2.640625 | 3 |
app/search.py | S4G4R/tv-tracker | 0 | 12797232 | <gh_stars>0
import tmdbsimple as tmdb
def search_movie(title):
"""
Connects to API to search for a specific movie by title.
"""
search = tmdb.Search()
response = search.movie(query=title)
return search.results
def search_tv(title):
"""
Connects to API to search for a specific tv show... | 2.703125 | 3 |
setup.py | JakobHavtorn/scholarscrape | 0 | 12797233 | <filename>setup.py
from setuptools import find_packages, setup
# Read requirements files
requirements_file = "requirements.txt"
with open(requirements_file) as buffer:
requirements = buffer.read().splitlines()
requirements = list(set(requirements))
requirements_string = "\n ".join(requirements)
print(f"Found th... | 1.992188 | 2 |
delivery_addresses/tests/test_delivery_address.py | stanwood/traidoo-api | 3 | 12797234 | <reponame>stanwood/traidoo-api<filename>delivery_addresses/tests/test_delivery_address.py
import random
import pytest
from model_bakery import baker
from delivery_addresses.models import DeliveryAddress
pytestmark = pytest.mark.django_db
def test_get_own_delivery_addresses(client_seller, seller, buyer):
baker.... | 2.265625 | 2 |
frame/noneatable/non_eatable.py | Rosikobu/snake-reloaded | 0 | 12797235 | import pygame
import random
from pygame.math import Vector2
#from .config import xSize, ySize, cell_size, cell_number
from .loc_conf import xSize, ySize, cell_number, cell_size
class NonEatable():
def __init__(self, screen, ip1,ip2,ip3,ip4):
# Lade Textur
self._load_texture(ip1,ip2,ip3,i... | 2.640625 | 3 |
main.py | aaryanDhakal22/scamn-t | 0 | 12797236 | import pyautogui
from time import sleep
from random import choice
sleep(3)
names = open("names.txt","r").readlines()
names = [i[:-1] for i in names]
passwords = open("pass.txt",'r').readlines()
passwords = [i[:-1] for i in passwords if passwords.index(i) % 2 == 0]
for i in range(100):
print("hehe :) ")
pyauto... | 3.203125 | 3 |
roster/client.py | trustedhousesitters/roster-python | 1 | 12797237 | <filename>roster/client.py<gh_stars>1-10
import time
import sys
import os
import signal
import random
import threading
from urlparse import urlparse
from datetime import datetime, timedelta
from registry import NewRegistry
from boto.dynamodb2.layer1 import DynamoDBConnection
from boto.dynamodb2 import connect_to_regio... | 2.234375 | 2 |
nvflare/private/fed/client/admin_msg_sender.py | ArnovanHilten/NVFlare | 2 | 12797238 | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# 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 ... | 2.015625 | 2 |
src/pandalchemy/generate_code.py | Dogeek/pandalchemy | 3 | 12797239 | <filename>src/pandalchemy/generate_code.py
from io import StringIO
from sqlalchemy import create_engine
from sqlalchemy import MetaData
from sqlacodegen.codegen import CodeGenerator
from importlib import import_module
def main():
connection_string = 'sqlite:///chinook.db'
engine = create_engine(connection_str... | 2.734375 | 3 |
benchmarks/launch_benchmark.py | s1113950/models | 0 | 12797240 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Intel Corporation
#
# 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
#
# Un... | 2.25 | 2 |
apps/api/tests/test_segmenting.py | IT2901-24-2018/orm | 2 | 12797241 | import unittest
from apps.api.segmenter.road_segmenter import geometry_to_list
from apps.data.road_segmenting.road_fetcher import vegnet_to_geojson
from apps.data.road_segmenting.road_filter import filter_road
from vapi.constants import MAX_SEGMENT_LENGTH, MIN_COORDINATES_LENGTH
from api.segmenter.calculate_distance ... | 2.90625 | 3 |
python/trinsic/proto/services/trustregistry/v1/__init__.py | musaib072/sdk | 6 | 12797242 | <reponame>musaib072/sdk
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: services/trust-registry/v1/trust-registry.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncIterator, Dict
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
... | 1.585938 | 2 |
modes.py | GreensCH/PYNQ-HLS-ImageProcessPlatform | 0 | 12797243 | <filename>modes.py
#mvt模式
#模型层
class User(object):
def __init__(self,uname,pwd):
self.uname=uname
self.pwd=<PASSWORD>
| 2.375 | 2 |
metrics/compute.py | XinyiYS/CML-RewardDistribution | 1 | 12797244 | import numpy as np
import pickle
import os
from pathlib import Path
from metrics.class_imbalance import get_classes, class_proportion
from metrics.phi_div import average_dkl
from metrics.wasserstein import wasserstein_2
def compute_metrics(ds,
split,
inv_temp,
... | 2.640625 | 3 |
self_supervised/loss/loss_intrin_selfsup.py | fgitmichael/SelfSupevisedSkillDiscovery | 0 | 12797245 | <filename>self_supervised/loss/loss_intrin_selfsup.py
import torch
import torch.nn.functional as F
from self_supervised.network.mode_latent_model import ModeLatentNetworkWithEncoder
import rlkit.torch.pytorch_util as ptu
def reconstruction_based_rewards(
mode_latent_model: ModeLatentNetworkWithEncoder,
... | 2.046875 | 2 |
django_request_user/__init__.py | aiakos/aiakos | 4 | 12797246 | <filename>django_request_user/__init__.py
default_app_config = 'django_request_user.apps.DjangoRequestUserConfig'
| 1.171875 | 1 |
src/orders/migrations/0003_auto_20200207_1825.py | saurabhsuryawanshi/ecommerce | 0 | 12797247 | # Generated by Django 2.0 on 2020-02-07 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('addresses', '0001_initial'),
('orders', '0002_auto_20200204_1253'),
]
operations = [
migrations.AddFi... | 1.664063 | 2 |
GUI/printer/Pillow-2.7.0/Tests/test_file_libtiff.py | y-gupta/rfid-auth-system | 5 | 12797248 | from helper import unittest, PillowTestCase, hopper, py3
import os
import io
from PIL import Image, TiffImagePlugin
class LibTiffTestCase(PillowTestCase):
def setUp(self):
codecs = dir(Image.core)
if "libtiff_encoder" not in codecs or "libtiff_decoder" not in codecs:
self.skipTest(... | 2.28125 | 2 |
tests/test_pyspark_hb_app_processor.py | ChinmaySKulkarni/hb-data | 0 | 12797249 | <filename>tests/test_pyspark_hb_app_processor.py<gh_stars>0
import unittest
from unittest.mock import Mock
from app_processor.pyspark_hb_app_processor import parse_configs, get_or_generate_spark_session
class TestAppProcessor(unittest.TestCase):
def test_parse_configs(self):
conf = parse_configs("test-c... | 2.59375 | 3 |
main.py | saber-khakbiz/DataScrapting-IR-Post | 0 | 12797250 | from stdiomask import getpass
from cowsay import daemon, ghostbusters, kitty
from check_validation_ID_Post import check_validation
from driver_chrome import *
from DataScrapting import *
tracking_ID = getpass("Enter Your Post Id(24 digit): ")
check_validation(tracking_ID)
URL = f"https://tracking.post.ir/?id={tracki... | 2.34375 | 2 |