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 |
|---|---|---|---|---|---|---|
tests/test_langs_fr.py | honzajavorek/tipi | 3 | 5600 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from tipi import tipi as _tipi
tipi = lambda s: _tipi(s, lang='fr')
def test_double_quotes():
assert tipi('''"brutal" "quote's"''') == (
'''«brutal» «quote's»'''
)
def test_single_quotes():
assert tipi("""'brutal'... | 2.546875 | 3 |
vendor/models.py | brethauer/mirage | 8 | 5601 | <gh_stars>1-10
from django.db import models
VEHICLE_CHOICES = (
('OASISSB', 'OASIS Small Business'),
('OASIS', 'OASIS Unrestricted')
)
STATUS_CHOICES = (
('P', 'In Progress'),
('C', 'Completed'),
('F', 'Cancelled')
)
class Vendor(models.Model):
name = models.CharField(max_length=128)
... | 2.125 | 2 |
two_qubit_simulator/circuits.py | L-McCormack/two-qubit-simulator | 0 | 5602 | """
Contains the QuantumCircuit class
boom.
"""
class QuantumCircuit(object): # pylint: disable=useless-object-inheritance
""" Implements a quantum circuit.
- - - WRITE DOCUMENTATION HERE - - -
"""
def __init__(self):
""" Initialise a QuantumCircuit object """
pass
def add_ga... | 2.53125 | 3 |
examples/bathymetricGradient.py | usgs/water-datapreptools | 2 | 5603 | import sys
sys.path.append("..") # change environment to see tools
from make_hydrodem import bathymetricGradient
workspace = r"" # path to geodatabase to use as a workspace
snapGrid = r"" # path to snapping grid
hucPoly = r"" # path to local folder polygon
hydrographyArea = r"" # path to NHD area feature class... | 2.15625 | 2 |
out/flowContext.py | hxb1997/Menge | 0 | 5604 | <filename>out/flowContext.py
# This is the OpenGL context for drawing flow calculation lines
from Context import *
from primitives import Vector2, Segment
from OpenGL.GL import *
from copy import deepcopy
class GLFlowSegment( Segment ):
'''The OpenGL representation of a flow line. Basically a segment
with a d... | 3.484375 | 3 |
instascrape/collectors/__init__.py | Paola351/instascrape | 1 | 5605 | <reponame>Paola351/instascrape
from .interval_collectors import *
| 1 | 1 |
Codes/gracekoo/test.py | ghoslation/algorithm | 256 | 5606 | # -*- coding: utf-8 -*-
# @Time: 2020/11/8 23:47
# @Author: GraceKoo
# @File: test.py
# @Desc:
from threading import Thread
import time
def print_numbers():
time.sleep(0.2)
print("子线程结束")
if __name__ == "__main__":
t1 = Thread(target=print_numbers)
t1.setDaemon(True)
t1.start()
# print("主线程结... | 2.828125 | 3 |
src/_main_/settings.py | gregory-chekler/api | 0 | 5607 | """
Django settings for massenergize_portal_backend project.
Generated by 'django-admin startproject' using Django 2.1.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/setting... | 1.625 | 2 |
aiorpcgrid/client.py | urands/aiorpcgrid | 0 | 5608 | import asyncio
# from aiorpcgrid.client import Client
from aiorpcgrid.task import AsyncTask, State
class AsyncClient:
_provider = None
_method = None
_requests: dict = {}
_running = True
_request_queue: asyncio.Queue = asyncio.Queue()
_loop = None
def __init__(self, provider, loop=None):... | 2.671875 | 3 |
python/src/otel/otel_sdk/opentelemetry/instrumentation/aws_lambda/__init__.py | matt-tyler/opentelemetry-lambda | 0 | 5609 | # Copyright 2020, OpenTelemetry 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 by applicable law or agreed to i... | 1.742188 | 2 |
instructors/migrations/0021_alter_user_avatar_url.py | bastoune57/gokiting_back_end | 0 | 5610 | # Generated by Django 4.0.2 on 2022-04-01 16:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('instructors', '0020_alter_user_description_alter_user_title'),
]
operations = [
migrations.AlterField(
model_name='user',
... | 1.554688 | 2 |
sopa/src/models/utils.py | SamplingAndEnsemblingSolvers/SamplingAndEnsemblingSolvers | 25 | 5611 | <filename>sopa/src/models/utils.py
import numpy as np
import torch
import random
from .odenet_mnist.layers import MetaNODE
def fix_seeds(seed=502):
np.random.seed(seed)
random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.set_printoptions(precision=10)
torc... | 2.234375 | 2 |
packages/micropython-official/v1.10/esp32/stubs/ubinascii.py | TheVinhLuong102/micropy-stubs | 18 | 5612 | <filename>packages/micropython-official/v1.10/esp32/stubs/ubinascii.py
"""
Module: 'ubinascii' on esp32 1.10.0
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.10.0', version='v1.10 on 2019-01-25', machine='ESP32 module with ESP32')
# Stubber: 1.2.0
def a2b_base64():
pass
def b2a_base64():
pass
def c... | 1.90625 | 2 |
jv/test_jv.py | chenwang/QuantEcon.lectures.code | 56 | 5613 | """
@author : <NAME>
"""
from __future__ import division
import sys
import unittest
from nose.plugins.skip import SkipTest
from jv import JvWorker
from quantecon import compute_fixed_point
from quantecon.tests import get_h5_data_file, write_array, max_abs_diff
# specify params -- use defaults
A = 1.4
alpha = 0.6
bet... | 1.976563 | 2 |
excentury/command/config.py | LaudateCorpus1/excentury | 0 | 5614 | """Config
This module is in charge of providing all the necessary settings to
the rest of the modules in excentury.
"""
import os
import re
import sys
import textwrap
import argparse
from collections import OrderedDict
from excentury.command import error, trace, import_mod
DESC = """Edit a configuration file for ex... | 2.546875 | 3 |
tests/test_urls.py | pkjmesra/nseta | 8 | 5615 | # -*- coding: utf-8 -*-
'''
Created on Thu Nov 19 20:52:33 2015
@author: SW274998
'''
from nseta.common.commons import *
import datetime
import unittest
import time
from bs4 import BeautifulSoup
from tests import htmls
import json
import requests
import six
from nseta.common.urls import *
import nseta.common.urls as ... | 2.078125 | 2 |
accounts/forms.py | cheradenine/Django-CRM | 2 | 5616 | from django import forms
from .models import Account
from common.models import Comment, Attachments
from leads.models import Lead
from contacts.models import Contact
from django.db.models import Q
class AccountForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
account_view = kwargs.pop('account'... | 2.1875 | 2 |
pywren/pywren_ibm_cloud/invokers.py | thetolga/pywren-ibm-cloud | 0 | 5617 | #
# Copyright 2018 PyWren Team
#
# 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... | 2.03125 | 2 |
Projet1/Dataset/addlinkRealExample.py | Arugakente/DataScienceP1 | 0 | 5618 | <filename>Projet1/Dataset/addlinkRealExample.py
import os
import random
inputDirectory = "./original"
outputDirectory = "./processed"
#probability parameters
TopLevel = 0.6
SecondLevel = 0.5
ThirdLevel = 0.4
FourAndAbove = 0.2
pickInside = 0.5
pickOutside = 0.25
topics = []
siteLevel = []
fileStructure = []
count... | 2.390625 | 2 |
kkcalc/kk.py | benajamin/kkcalc | 0 | 5619 | <reponame>benajamin/kkcalc<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Kramers-Kronig Calculator software package.
#
# Copyright (c) 2013 <NAME>, <NAME>
#
# The software is licensed under the terms of the zlib/libpng license.
# For details see LICENSE.txt
"""This module impleme... | 2.3125 | 2 |
random-images/hexxy.py | dominicschaff/random | 0 | 5620 | <reponame>dominicschaff/random
from PIL import ImageDraw, Image
from math import cos,sin,radians
from random import randint
import sys
a = "a0A1b2B3c4C5d6D7e8E9f!F,g.G/h?H<i>I:j;J'k\"K\\l|L/m M\nn\tN@o#O$p%P^q&Q*r(R)s_S-t+T=u{U}v[V]w W x X y Y z Z"
if len(a) > 128:
print("TOO MANY CHARACTERS")
sys.exit(1)
# f... | 2.671875 | 3 |
src/plugins/maimaidx.py | LonelyFantasy/Chiyuki-Bot | 0 | 5621 | <reponame>LonelyFantasy/Chiyuki-Bot
import math
from collections import defaultdict
from typing import List, Dict, Any
from nonebot import on_command, on_message, on_notice, on_regex, get_driver
from nonebot.log import logger
from nonebot.permission import Permission
from nonebot.typing import T_State
from nonebot.ada... | 2.109375 | 2 |
trace_analysis/trace_analysis/architecture/interface.py | hsgwa/trace_analysis | 0 | 5622 | <gh_stars>0
# Copyright 2021 Research Institute of Systems Planning, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 2.1875 | 2 |
disrank/__init__.py | treehousekingcomic/disrank | 1 | 5623 | from thkc_disrank import *
| 1.085938 | 1 |
layers/gin_layer.py | JakeStevens/benchmarking-gnns | 275 | 5624 | <reponame>JakeStevens/benchmarking-gnns<gh_stars>100-1000
import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl.function as fn
"""
GIN: Graph Isomorphism Networks
HOW POWERFUL ARE GRAPH NEURAL NETWORKS? (<NAME>, <NAME>, <NAME> and <NAME>, ICLR 2019)
https://arxiv.org/pdf/1810.00826.... | 3.03125 | 3 |
music/distance/aural/diatonic/__init__.py | jedhsu/music | 0 | 5625 | <filename>music/distance/aural/diatonic/__init__.py
"""
*mus . it . dia*
The simple diatonic intervals.
"""
from .second import MinorSecond
from .second import MajorSecond
from .third import MinorThird
from .third import MajorThird
from .fourth import PerfectFourth
from .fifth import Tritone
from .fifth impor... | 1.601563 | 2 |
selenium_tests/test_functions.py | AriTheGuitarMan/AriTheGuitarMan.github.io | 0 | 5626 | <reponame>AriTheGuitarMan/AriTheGuitarMan.github.io
# this file holds some common testing functions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
depurl = "localhost:3000"
def getElement(driver, xp... | 2.4375 | 2 |
papirus_renderer.py | ryuchihoon/WeatherStation | 0 | 5627 | #-- coding: utf-8 --
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import time
import collections
from PIL import Image, ImageOps, ImageDraw, ImageFont
code_2_icono = collections.defaultdict(lambda : '38')
kor_2_eng = collections.defaultdict(lambda : 'UNKNOWN')
code_2_icono['SKY_O00'] = ['38']
... | 2.171875 | 2 |
hydrobox/discharge/__init__.py | VForWaTer/hydrobox | 4 | 5628 | from .catchment import regime, flow_duration_curve
from . import indices | 0.988281 | 1 |
scripts/convert_keras2onnx.py | ecmwf-lab/infero | 8 | 5629 | <reponame>ecmwf-lab/infero
#
# (C) Copyright 1996- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its... | 2.234375 | 2 |
src/lava/lib/dl/slayer/utils/assistant.py | timcheck/lava-dl | 37 | 5630 | # Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
"""Assistant utility for automatically load network from network
description."""
import torch
class Assistant:
"""Assistant that bundles training, validation and testing workflow.
Parameters
----------
net : torch.nn.Mo... | 2.59375 | 3 |
lstm-synthetic-wave-anomaly-detect.py | cse-icon-dataAnalytics/lstm-anomaly-detect | 178 | 5631 | <reponame>cse-icon-dataAnalytics/lstm-anomaly-detect
""" Inspired by example from
https://github.com/Vict0rSch/deep_learning/tree/master/keras/recurrent
Uses the TensorFlow backend
The basic idea is to detect anomalies in a time-series.
"""
import matplotlib.pyplot as plt
import numpy as np
import time
from keras.layer... | 3.484375 | 3 |
hpc-historias-clinicas/historias/migrations/0007_auto_20150425_1459.py | btenaglia/hpc-historias-clinicas | 0 | 5632 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('historias', '0006_auto_20150413_0001'),
]
operations = [
migrations.AlterField(
model_name='hist... | 1.648438 | 2 |
venv/Lib/site-packages/har2case/__about__.py | Verckolf/MyInterfaceTest | 0 | 5633 | __title__ = 'har2case'
__description__ = 'Convert HAR(HTTP Archive) to YAML/JSON testcases for HttpRunner.'
__url__ = 'https://github.com/HttpRunner/har2case'
__version__ = '0.2.0'
__author__ = 'debugtalk'
__author_email__ = '<EMAIL>'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright 2017 debugtalk' | 1.109375 | 1 |
app_id_utils.py | woctezuma/match-steam-banners | 0 | 5634 | import os
from pathlib import Path
from data_utils import get_data_path, get_image_data_path, get_image_extension
def app_id_to_image_filename(app_id, is_horizontal_banner=False):
image_data_path = get_image_data_path(is_horizontal_banner)
image_filename = image_data_path + str(app_id) + get_image_extension... | 2.453125 | 2 |
upload.py | sjm446/aMAZEd | 0 | 5635 | <reponame>sjm446/aMAZEd
#!/usr/bin/env python
import boto3
import random
import os
BUCKET=os.environ.get('EXPORT_S3_BUCKET_URL')
if (BUCKET != None):
s3 = boto3.client('s3')
with open("maze.txt", "rb") as f:
s3.upload_fileobj(f, BUCKET, "maze"+str(random.randrange(100000))+".txt")
else:
print("EXPOR... | 2.53125 | 3 |
zerver/management/commands/list_realms.py | rtzll/zulip | 0 | 5636 | <filename>zerver/management/commands/list_realms.py<gh_stars>0
import sys
from typing import Any
from argparse import ArgumentParser
from zerver.models import Realm
from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand):
help = """List realms in the server and it's configuration sett... | 2.53125 | 3 |
tests/integration/ec2/test_connection.py | bopopescu/debpkg_python-boto | 15 | 5637 | # Copyright (c) 2006-2010 <NAME> http://garnaat.org/
# Copyright (c) 2009, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restrictio... | 2.015625 | 2 |
docusign_esign/models/conditional_recipient_rule_filter.py | joekohlsdorf/docusign-esign-python-client | 58 | 5638 | <filename>docusign_esign/models/conditional_recipient_rule_filter.py
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: <EMAIL>
Generated... | 1.867188 | 2 |
conman/routes/apps.py | meshy/django-conman | 0 | 5639 | <reponame>meshy/django-conman
from django.apps import AppConfig
from django.core.checks import register
from . import checks
class RouteConfig(AppConfig):
"""The AppConfig for conman routes."""
name = 'conman.routes'
def ready(self):
"""Register checks for conman routes."""
register(chec... | 2.234375 | 2 |
Other/transactionlog entries since timestamp.py | DJHig/TM1py-samples | 1 | 5640 | <filename>Other/transactionlog entries since timestamp.py
"""
Get all TM1 transactions for all cubes starting to a specific date.
"""
import configparser
config = configparser.ConfigParser()
config.read('..\config.ini')
from datetime import datetime
from TM1py.Services import TM1Service
with TM1Service(**config['t... | 2.96875 | 3 |
src/patteRNA/Dataset.py | AviranLab/patteRNA | 12 | 5641 | <filename>src/patteRNA/Dataset.py
import logging
import numpy as np
from scipy.stats import entropy
from patteRNA.Transcript import Transcript
from patteRNA import filelib
logger = logging.getLogger(__name__)
class Dataset:
def __init__(self, fp_observations, fp_sequences=None, fp_references=None):
self.... | 2.453125 | 2 |
src/Simulation/developer_0/main.py | GYRY-NEU/CS7610-Experiments | 0 | 5642 | <reponame>GYRY-NEU/CS7610-Experiments
import library
import json
@library.export
def init(args):
model = [[9.2, 0.21, 0.21],
[8.2, 0.22, 0.21],
[7.2, 1.21, 2.41],
[1.2, 2.21, 0.29]]
library.put("model", model)
ROUND = 0
library.put("ROUND", ROUND)
alpha = 0.2
... | 2.421875 | 2 |
molecule_ignite/test/unit/test_driver.py | ragingpastry/molecule-ignite | 17 | 5643 | <reponame>ragingpastry/molecule-ignite
from molecule import api
def test_driver_is_detected():
driver_name = __name__.split(".")[0].split("_")[-1]
assert driver_name in [str(d) for d in api.drivers()]
| 2.25 | 2 |
coffeine/pipelines.py | dengemann/meegpowreg | 6 | 5644 | import numpy as np
from coffeine.covariance_transformers import (
Diag,
LogDiag,
ExpandFeatures,
Riemann,
RiemannSnp,
NaiveVec)
from coffeine.spatial_filters import (
ProjIdentitySpace,
ProjCommonSpace,
ProjLWSpace,
ProjRandomSpace,
ProjSPoCSpace)
from sklearn.compose impor... | 2.703125 | 3 |
submissions/Chouard/mygames.py | dysomni/aima-python | 0 | 5645 | <gh_stars>0
from games import Game
from math import nan, isnan
from queue import PriorityQueue
from copy import deepcopy
from utils import isnumber
from grading.util import print_table
class GameState:
def __init__(self, to_move, position, board, label=None):
self.to_move = to_move
self.position =... | 3.421875 | 3 |
discordbot/stocks/options/opt_chain.py | minhhoang1023/GamestonkTerminal | 1 | 5646 | import os
import df2img
import disnake
import numpy as np
import pandas as pd
from menus.menu import Menu
from PIL import Image
import discordbot.config_discordbot as cfg
from discordbot.config_discordbot import gst_imgur, logger
from discordbot.helpers import autocrop_image
from gamestonk_terminal.stocks.options imp... | 2.484375 | 2 |
scripts/get_lenderprofit.py | xujiahuayz/premfin | 4 | 5647 | <filename>scripts/get_lenderprofit.py
#%% import packages
import numpy as np
import pandas as pd
import multiprocessing
from time import time
import json
from premiumFinance.constants import (
MORTALITY_TABLE_CLEANED_PATH,
PROCESSED_PROFITABILITY_PATH,
)
from premiumFinance.financing import calculate_lender_p... | 2.34375 | 2 |
dashboard/dashboard/common/layered_cache.py | BearerPipelineTest/catapult | 0 | 5648 | <reponame>BearerPipelineTest/catapult<gh_stars>0
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Caches processed query results in memcache and datastore.
Memcache is not very reliable for the perf dash... | 1.796875 | 2 |
hypergbm/tests/cuml_/run_experiment_cuml.py | BigAndSweet/HyperGBM | 0 | 5649 | # -*- coding:utf-8 -*-
"""
"""
import cudf
from hypergbm import make_experiment
from hypernets.tabular import get_tool_box
from hypernets.tabular.datasets import dsutils
def main(target='y', dtype=None, max_trials=3, drift_detection=False, clear_cache=True, **kwargs):
tb = get_tool_box(cudf.DataFrame)
asse... | 2.28125 | 2 |
Inserter.py | DarthSpector/Poster-Adder | 0 | 5650 | <gh_stars>0
def pictureInserter(og,address,list):
j=0
for i in og:
file1 = open(address+'/'+i, "a")
x="\ncover::https://image.tmdb.org/t/p/original/"+list[j]
file1.writelines(x)
file1.close()
j=j+1
| 2.828125 | 3 |
datasets/imagenet.py | xhchrn/open_lth | 9 | 5651 | <gh_stars>1-10
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import concurrent.futures
import numpy as np
import os
from PIL import Image
import torchvision
from datasets import base
from ... | 2.375 | 2 |
sm4.py | ZelKnow/sm4 | 0 | 5652 | <filename>sm4.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : sm4.py
@Description : sm4加密算法的实现
@Date : 2021/10/28 15:59:51
@Author : ZelKnow
@Github : https://github.com/ZelKnow
"""
__author__ = "ZelKnow"
from argparse import ArgumentParser, ArgumentError
from binascii ... | 2.71875 | 3 |
sendotp/sendotp.py | saadmk11/sendotp-python | 5 | 5653 | <reponame>saadmk11/sendotp-python<filename>sendotp/sendotp.py
import json
import requests
from random import randint
class sendotp:
def __init__(self, key, msg):
self.baseUrl = "http://control.msg91.com"
self.authkey = key
try:
msg
except NameError:
self.... | 2.984375 | 3 |
leetcode/1021-remove-outermost-parentheses.py | tjeubaoit/algorithm | 0 | 5654 | class Solution:
def removeOuterParentheses(self, s: str) -> str:
ans = []
ct = 0
for ch in s:
if ch == '(':
ct += 1
if ct != 1:
ans.append(ch)
else:
ct -= 1
if ct != 0:
... | 3.375 | 3 |
venv/Scripts/ex049.py | SamuelNunesDev/starting_point_in_python | 0 | 5655 | n = int(input('Digite um número para ver sua tabuada: '))
for c in range(0, 11):
print(f'{n} * {c} = {n * c}')
| 3.875 | 4 |
js2py/evaljs.py | inprod/Js2Py | 0 | 5656 | <reponame>inprod/Js2Py
# coding=utf-8
from .translators import translate_js, DEFAULT_HEADER
from .es6 import js6_to_js5
import sys
import time
import json
import six
import os
import hashlib
import codecs
__all__ = [
'EvalJs', 'translate_js', 'import_js', 'eval_js', 'translate_file',
'eval_js6', 'translate_js6... | 2.296875 | 2 |
setup.py | mvduin/py-uio | 38 | 5657 | #!/usr/bin/python3
from setuptools import setup, find_packages
setup(
package_dir = { '': 'src' },
packages = find_packages( where='src' ),
)
| 1.429688 | 1 |
tools/verity_utils.py | FabriSC/Alioth-SC | 3 | 5658 | #!/usr/bin/env python
#
# Copyright (C) 2018 The Android Open Source Project
#
# 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 req... | 1.992188 | 2 |
orgviz/dones.py | tkf/orgviz | 8 | 5659 | <filename>orgviz/dones.py
#!/usr/bin/env python
"""org archive to html table converter"""
import os
import datetime
import itertools
from .utils.date import minutestr, total_minutes
def rootname_from_archive_olpath(node):
"""
Find rootname from ARCHIVE_OLPATH property.
Return None if not found.
"""
... | 2.6875 | 3 |
tests/python/unittest/test_lang_tag.py | ravikumarvc/incubator-tvm | 3 | 5660 | # 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
# "License"); you may not u... | 2.03125 | 2 |
doepy/case_studies/discrete_time/MSFB2014.py | scwolof/doepy | 1 | 5661 | <reponame>scwolof/doepy<gh_stars>1-10
"""
MIT License
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | 1.726563 | 2 |
house_code/tutorials_altered/3D_positioning_and_orientation.py | mukobi/Pozyx-Gabe | 1 | 5662 | #!/usr/bin/env python
"""
The pozyx ranging demo (c) Pozyx Labs
please check out https://www.pozyx.io/Documentation/Tutorials/getting_started/Python
This demo requires one (or two) pozyx shields. It demonstrates the 3D orientation and the functionality
to remotely read register data from a pozyx device. Connect one of... | 2.71875 | 3 |
hdfs_kernel/exceptions.py | Jasper912/jupyter-hdfs-kernel | 3 | 5663 | <reponame>Jasper912/jupyter-hdfs-kernel
#!/usr/bin/env python
# -*- coding=utf-8 -*-
#
# Author: huangnj
# Time: 2019/09/27
import traceback
from functools import wraps
from hdfs_kernel.constants import EXPECTED_ERROR_MSG, INTERNAL_ERROR_MSG
from hdfs.util import HdfsError
# == EXCEPTIONS ==
class SessionManagementEx... | 2.25 | 2 |
dashboard/tests/test_inventory.py | vishalvvr/transtats | 0 | 5664 | # Copyright 2017 Red Hat, Inc.
# 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 applicable law or a... | 1.960938 | 2 |
web_console_v2/api/fedlearner_webconsole/rpc/server.py | nolanliou/fedlearner | 0 | 5665 | # Copyright 2020 The FedLearner Authors. 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 applica... | 1.804688 | 2 |
chapter15/async_aiohttp.py | haru-256/ExpertPython3_Source | 9 | 5666 | <reponame>haru-256/ExpertPython3_Source<filename>chapter15/async_aiohttp.py<gh_stars>1-10
"""
「非同期プログラミング」の節で登場するサンプルコード
aiohttpを使って非同期にHTTPのリクエストを送信する方法
"""
import asyncio
import time
import aiohttp
from asyncrates import get_rates
SYMBOLS = ('USD', 'EUR', 'PLN', 'NOK', 'CZK')
BASES = ('USD', 'EUR', 'PLN', 'NOK', ... | 2.953125 | 3 |
experiments/nginx/run.py | OleksiiOleksenko/intel_mpx_explained | 15 | 5667 | #!/usr/bin/env python
from __future__ import print_function
import logging
import os
import signal
from time import sleep
from subprocess import Popen, PIPE
import socket
from core.common_functions import *
from core.run import Runner
class NginxPerf(Runner):
"""
Runs Nginx
"""
name = "nginx"
e... | 2.359375 | 2 |
tavi/test/unit/base/document_no_fields_test.py | verdammelt/tavi | 0 | 5668 | <gh_stars>0
# -*- coding: utf-8 -*-
import unittest
from tavi.base.documents import BaseDocument
class BaseDocumentNoFieldsTest(unittest.TestCase):
class NoFieldsSample(BaseDocument):
pass
def setUp(self):
super(BaseDocumentNoFieldsTest, self).setUp()
self.no_fields_sample = self.NoFi... | 2.328125 | 2 |
seqparse/test/test_seqparse.py | hoafaloaf/seqparse | 1 | 5669 | """Test file sequence discovery on disk."""
# "Future" Libraries
from __future__ import print_function
# Standard Libraries
import os
import unittest
# Third Party Libraries
import mock
from builtins import range
from future.utils import lrange
from . import (DirEntry, generate_entries, initialise_mock_scandir_data... | 2.578125 | 3 |
deliveroo_scraping.py | ragreener1/deliveroo-scraping | 0 | 5670 | <filename>deliveroo_scraping.py
import urllib.request
import pandas as pd
import sqlite3
import re
from bs4 import BeautifulSoup
# Parameters
postcodes_list = ["W1F7EY"]
db_name = "scraped.db"
# This is so that Deliveroo think the scraper is Google Chrome
# as opposed to a web scraper
hdr = {'User-Agent': 'Mozilla/... | 3.59375 | 4 |
wouso/core/security/admin.py | AlexandruGhergut/wouso | 117 | 5671 | from django.contrib import admin
from wouso.core.security.models import Report
admin.site.register(Report)
| 1.0625 | 1 |
DataWrangling/TTNData2Gsheet_Auto.py | diliprk/SmartCityVisualization | 0 | 5672 | <filename>DataWrangling/TTNData2Gsheet_Auto.py
#### Reading Data from The Things Network Data and Automatically Storing it to a Google Spreadsheet
# Author: <NAME>
# Email: <EMAIL>
# Date: 19/01/2018
# Revision: version#1
# License: MIT License
import pandas as pd
import requests
from df2gspread import df2gspread as ... | 3.140625 | 3 |
alleycat/reactive/property.py | mysticfall/alleycat-reactive | 14 | 5673 | from __future__ import annotations
from typing import TypeVar, Generic, Callable, Optional, Any, cast, Tuple
import rx
from returns import pipeline
from returns.functions import identity
from returns.maybe import Maybe, Nothing
from rx import Observable
from rx.subject import BehaviorSubject
from . import ReactiveVa... | 2.109375 | 2 |
utils/mask/converter.py | csgcmai/cvat | 4 | 5674 | #!/usr/bin/env python
#
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import absolute_import, division, print_function
import argparse
import os
import glog as log
import numpy as np
import cv2
from lxml import etree
from tqdm import tqdm
def parse_args():
"""Parse argu... | 2.609375 | 3 |
examples/plot_afq_callosal.py | gkiar/pyAFQ | 0 | 5675 | <reponame>gkiar/pyAFQ
"""
==========================
Callosal bundles using AFQ API
==========================
An example using the AFQ API to find callosal bundles using the templates from:
http://hdl.handle.net/1773/34926
"""
import os.path as op
import plotly
from AFQ import api
from AFQ.mask import RoiMask
import... | 1.820313 | 2 |
latest/probe.py | Soldie/Nscan-scanner-ip | 574 | 5676 | import time
import Queue
import random
import socket
import struct
import logging
import threading
from convert import *
from protocol import ethernet, ip, tcp, udp
ETH_P_IP = 0x0800 # IP protocol
ETH_P_ALL = 0x0003 # Every packet
NSCRIPT_PATH = 'nscript' # NSCRIPT PATH
PAYLOAD = {
53:('\x5d\x0d\x01\x00\x00\x01\x00... | 2.125 | 2 |
parsy-backend/flaskApp/assignment/views.py | dstambler17/Parsy.io | 0 | 5677 | import sys
from flask import Blueprint, request, jsonify
from flaskApp import db
from flaskApp.assignment.utils import *
from flaskApp.error.error_handlers import *
import json
from flaskApp.helpers import getAssignmentData
assignment = Blueprint('assignment', __name__)
@assignment.route('/restoreAssignment/<calID>/<... | 2.328125 | 2 |
python/patterns/slidingwindow/longest_substring_no_repeating_char.py | dharmik-thakkar/dsapatterns | 0 | 5678 | #######################################################################################################################
# Given a string, find the length of the longest substring which has no repeating characters.
#
# Input: String="aabccbb"
# Output: 3
# Explanation: The longest substring without any repeating charact... | 4.09375 | 4 |
Apache Spark with Python - Big Data with PySpark and Spark/6-PairRDD/filter/AirportsNotInUsa.py | jrderek/Big_Data_Engineering_Portfolio | 0 | 5679 | <filename>Apache Spark with Python - Big Data with PySpark and Spark/6-PairRDD/filter/AirportsNotInUsa.py
import sys
sys.path.insert(0, '.')
from pyspark import SparkContext, SparkConf
from commons.Utils import Utils
if __name__ == "__main__":
'''
Create a Spark program to read the airport data fr... | 3.40625 | 3 |
linux/keyman-config/keyman_config/keyboard_details.py | srl295/keyman | 0 | 5680 | <reponame>srl295/keyman
#!/usr/bin/python3
# Keyboard details window
import logging
import json
from os import path
import qrcode
import tempfile
import gi
from gi.repository import Gtk
from keyman_config import KeymanComUrl, _, secure_lookup
from keyman_config.accelerators import init_accel
from keyman_config.kmpm... | 2.28125 | 2 |
build_osx/copy_runtime.py | ozsolarwind/SAM | 0 | 5681 | import os
import shutil
SOURCE_DIR = '../deploy/runtime'
TARGET_DIR = 'SAM.app/Contents/runtime'
if os.path.exists(TARGET_DIR):
shutil.rmtree(TARGET_DIR)
shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=shutil.ignore_patterns('.git'))
SOURCE_DIR = '../deploy/solar_resource'
TARGET_DIR = 'SAM.app/Contents/solar_re... | 2.125 | 2 |
codalab/lib/path_util.py | kl-chou/codalab-worksheets | 236 | 5682 | <filename>codalab/lib/path_util.py
"""
path_util contains helpers for working with local filesystem paths.
There are a few classes of methods provided here:
Functions to normalize paths and check that they are in normal form:
normalize, check_isvalid, check_isdir, check_isfile, path_is_url
Functions to list d... | 2.78125 | 3 |
statsmodels/regression/tests/test_glsar_gretl.py | aliavni/statsmodels | 1 | 5683 | # -*- coding: utf-8 -*-
"""Tests of GLSAR and diagnostics against Gretl
Created on Thu Feb 02 21:15:47 2012
Author: <NAME>
License: BSD-3
"""
import os
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal,
assert_allclose, assert_array_less)
from statsmodels.r... | 1.820313 | 2 |
core/views.py | tweeprint/api.tweeprint.com | 1 | 5684 | <gh_stars>1-10
import requests
import django.contrib.auth as auth
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse, JsonResponse, Http404
from django.contrib.auth.decorators import login_required
from django.core.serializers import serialize
from core.serializers imp... | 2.03125 | 2 |
src/framed/bioreactor/__init__.py | cdanielmachado/framed | 25 | 5685 | <gh_stars>10-100
from __future__ import absolute_import
__author__ = 'kaizhuang'
"""
Package implementing features for simulating bioreactor operation.
"""
from .base import Organism, Bioreactor
from .bioreactors import ANAEROBIC, AEROBIC, MICROAEROBIC
from .bioreactors import Bioreactor_ox, IdealBatch, IdealFedbatch
... | 1.15625 | 1 |
shared/templates/coreos_kernel_option/template.py | deperrone/content | 1,138 | 5686 | <reponame>deperrone/content<filename>shared/templates/coreos_kernel_option/template.py
from ssg.utils import parse_template_boolean_value
def preprocess(data, lang):
data["arg_negate"] = parse_template_boolean_value(data, parameter="arg_negate", default_value=False)
data["arg_is_regex"] = parse_template_boole... | 1.929688 | 2 |
pondus/backends/__init__.py | enicklas/pondus | 1 | 5687 | # -*- coding: UTF-8 -*-
"""
This file is part of Pondus, a personal weight manager.
Copyright (C) 2011 <NAME> <<EMAIL>>
This program is free software licensed under the MIT license. For details
see LICENSE or http://www.opensource.org/licenses/mit-license.php
"""
__all__ = ['csv_backend', 'sportstracker_backend', '... | 0.84375 | 1 |
setup.py | specialprocedures/chpy | 0 | 5688 | <filename>setup.py
import pathlib
from setuptools import find_packages, setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
# This call to setup() does all the work
setup(
name="chpy",
version="0.1... | 1.640625 | 2 |
src/sentry/eventtypes/error.py | boblail/sentry | 0 | 5689 | <gh_stars>0
from __future__ import absolute_import
import six
from sentry.utils.safe import get_path, trim
from sentry.utils.strings import truncatechars
from .base import BaseEvent
def get_crash_location(exception, platform=None):
default = None
for frame in reversed(get_path(exception, 'stacktrace', 'fra... | 2.09375 | 2 |
keras_en_parser_and_analyzer/library/tests/test_detect_date.py | Sultan91/keras-english-resume-parser-and-analyzer | 0 | 5690 | from unittest import TestCase
from datetime import date
from keras_en_parser_and_analyzer.library.pipmp_my_cv_classify import detect_date
class DetectDate(TestCase):
def test_detect_date(self):
dates_to_test = ['10-1990', '09/12/2020', 'jan 1990', 'feb 2012', '9-12-2020']
res = detect_date(dates_t... | 3 | 3 |
capirca/lib/ipset.py | google-admin/capirca | 604 | 5691 | # Copyright 2015 Google Inc. 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 applicable law or a... | 2.09375 | 2 |
straxen/analyses/records_matrix.py | zhut19/straxen | 14 | 5692 | import warnings
import numba
import numpy as np
import strax
import straxen
DEFAULT_MAX_SAMPLES = 20_000
@straxen.mini_analysis(requires=('records',),
warn_beyond_sec=10,
default_time_selection='touching')
def records_matrix(records, time_range, seconds_range, config, ... | 2.421875 | 2 |
bdbc/lib/python3.5/site-packages/bigchaindb_driver/crypto.py | entropyx/fiduchain-blockchain-interface | 0 | 5693 | from collections import namedtuple
from cryptoconditions import crypto
CryptoKeypair = namedtuple('CryptoKeypair', ('signing_key', 'verifying_key'))
def generate_keypair():
"""Generates a cryptographic key pair.
Returns:
:class:`~bigchaindb_driver.crypto.CryptoKeypair`: A
:obj:`collections... | 3.03125 | 3 |
reviewboard/webapi/resources/change.py | mnoorenberghe/reviewboard | 0 | 5694 | <reponame>mnoorenberghe/reviewboard
from __future__ import unicode_literals
from django.utils import six
from djblets.util.decorators import augment_method_from
from reviewboard.changedescs.models import ChangeDescription
from reviewboard.reviews.fields import get_review_request_field
from reviewboard.webapi.base imp... | 1.796875 | 2 |
controllers/notes/NewNote.py | heminsatya/free_notes | 0 | 5695 | # Dependencies
from aurora import Controller, View, Forms
from models import Users, Notes
from aurora.security import login_required, get_session
from flask import request
from datetime import datetime
# The controller class
class NewNote(Controller):
# POST Method
@login_required(app='users')
def post(se... | 2.78125 | 3 |
EDA-&-Data-Preprocessing/code.py | udayraj-gupta/ga-learner-dsmp-repo | 0 | 5696 | # --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
data['Rating'].hist()
data = data[data['Rating']<=5]
data['Rating'].hist()
#Code ends here
# --------------
# code starts here
total_null = data.isnull().sum... | 2.96875 | 3 |
openpnm/algorithms/ChargeConservation.py | rguan-uoft/OpenPNM | 1 | 5697 | import numpy as np
from openpnm.algorithms import ReactiveTransport
from openpnm.models.physics import generic_source_term as gst
from openpnm.utils import logging
logger = logging.getLogger(__name__)
class ChargeConservation(ReactiveTransport):
r"""
A class to enforce charge conservation in ionic transport s... | 2.65625 | 3 |
jno/commands/upload.py | Kosinkadink/jno | 1 | 5698 | from jno.util import interpret_configs
from jno.util import run_arduino_process
from jno.util import create_build_directory
from jno.util import get_common_parameters
from jno.util import verify_arduino_dir
from jno.util import verify_and_get_port
from jno.util import JnoException
from jno.commands.command import Comma... | 2.484375 | 2 |
modelling/inference_multi_attribute.py | rizwan09/hydra-sum | 5 | 5699 | import argparse
import json
import logging
import os
import torch
from transformers.file_utils import ModelOutput
from typing import Dict, Optional, Tuple
from torch.utils.data import DataLoader, SequentialSampler
from transformers.modeling_outputs import Seq2SeqLMOutput
import train_seq2seq_utils
import single_head_ut... | 2.046875 | 2 |