max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
src/train/test.py | jiangqn/RNNLM | 1 | 12798251 | <filename>src/train/test.py<gh_stars>1-10
import os
import torch
from torch import nn
from torch.utils.data.dataloader import DataLoader
from src.data_process.dataset import LMDataset
from src.train.eval import eval
from src.utils.constants import PAD_INDEX
from src.utils.logger import Logger
def test(args):
os.en... | 2.03125 | 2 |
database_build/dbpedia_run_log_http.py | derdav3/tf-sparql | 5 | 12798252 | <reponame>derdav3/tf-sparql<filename>database_build/dbpedia_run_log_http.py<gh_stars>1-10
from multiprocessing import Pool
import re, sys, requests, random, json
import time as timesleep
import numpy as np
from tqdm import *
from urlparse import urlparse, parse_qs
import urllib
from datetime import datetime, time
fall... | 2.234375 | 2 |
setup.py | finnish-heritage-agency/passari-web-ui | 1 | 12798253 | from setuptools import setup, find_packages
NAME = "passari_web_ui"
DESCRIPTION = (
"Web interface for Passari workflow"
)
LONG_DESCRIPTION = DESCRIPTION
AUTHOR = "<NAME>"
AUTHOR_EMAIL = "<EMAIL>"
setup(
name=NAME,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author=AUTHOR,
au... | 1.34375 | 1 |
classification.py | Gusyatnikova/argument-mining-rus | 0 | 12798254 | <reponame>Gusyatnikova/argument-mining-rus
import os
import pickle
import nltk as nltk
from nltk.classify import SklearnClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import MultinomialNB, BernoulliNB
from data_manager import DataManager
correct_labels = ['Premise', 'Claim', 'M... | 2.78125 | 3 |
blog/urls.py | minielectron/portfolio | 0 | 12798255 | from django.urls import path
from . import views
app_name="blog" #Works as namespace
urlpatterns = [
path('', views.blogs, name="blog"),
path('<int:blog_id>', views.detail, name="detail")
] | 1.8125 | 2 |
ch16/app.py | rauhaanrizvi/code | 10 | 12798256 | from pyreact import setTitle, useEffect, useState, render, createElement as el
def App():
newTask, setNewTask = useState("")
editTask, setEditTask = useState(None)
taskList, setTaskList = useState([])
taskCount, setTaskCount = useState(0)
taskFilter, setTaskFilter = useState("all")
def handleS... | 2.765625 | 3 |
setup.py | grantjenks/python-appstore | 1 | 12798257 | from io import open
from setuptools import setup
from setuptools.command.test import test as TestCommand
import appstore
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
impor... | 1.90625 | 2 |
img_vec.py | janisoteps/imsim1 | 0 | 12798258 | <reponame>janisoteps/imsim1
# from keras.models import Model
# from keras.layers import Flatten, Dense, Input
# from keras.utils.data_utils import get_file
# from keras import backend as K
from keras.layers import Dense
from tensorflow.python.framework import ops
import tensorflow as tf
sess = tf.Session()
from kera... | 2.875 | 3 |
thanks/package_tools.py | vsprogrammer2909/thanks | 168 | 12798259 | <filename>thanks/package_tools.py
from functools import reduce
from itertools import chain, takewhile
import os
import pkg_resources
import re
class MetaDataNotFound(Exception):
pass
def get_local_dist(package_name):
working_set = dict(
(dist.project_name, dist) for dist in pkg_resources.WorkingSet(... | 2.234375 | 2 |
kubernetes_manager/models/base.py | breimers/Django-Kubernetes-Manager | 13 | 12798260 | <reponame>breimers/Django-Kubernetes-Manager
import json
from tempfile import NamedTemporaryFile
from uuid import uuid4
from django.contrib.postgres.fields import JSONField
from django.db import models
from kubernetes import client, config
class KubernetesBase(models.Model):
"""
KubernetesBase
:type: mo... | 1.953125 | 2 |
demos/video_demo.py | ALEXKIRNAS/tensorflow-fast-style-transfer | 0 | 12798261 | <reponame>ALEXKIRNAS/tensorflow-fast-style-transfer
from moviepy.video.io.ffmpeg_reader import FFMPEG_VideoReader
from tqdm import tqdm
import cv2
from utils.demo_utils import StyleTransferDemo
import numpy as np
from typing import List
import click
def get_frames(video_path: str) -> List[np.ndarray]:
"""
Loa... | 3.03125 | 3 |
logs/main.py | akshitdewan/cs61a-apps | 5 | 12798262 | <reponame>akshitdewan/cs61a-apps
from html import escape
from json import loads
from flask import Flask, abort
from common.oauth_client import create_oauth_client, get_user, is_staff, login
from common.shell_utils import sh
from common.url_for import url_for
from common.rpc.auth import is_admin
app = Flask(__name__,... | 2.25 | 2 |
nb_train_iib.py | icrdr/3D-UNet-Renal-Anatomy-Extraction | 0 | 12798263 | # %%
from trainer import Trainer
from network import ResUnet3D, ResAttrUnet3D, ResAttrUnet3D2, ResAttrBNUnet3D
from loss import Dice, HybirdLoss, DiceLoss, FocalLoss
from data import CaseDataset
from torchvision.transforms import Compose
from transform import Crop, RandomCrop, ToTensor, CombineLabels, \
RandomBrig... | 1.585938 | 2 |
features/steps/levenshtein_steps.py | clibc/howabout | 2 | 12798264 | <filename>features/steps/levenshtein_steps.py
import random
from behave import given, when, then
from howabout import get_levenshtein
@given('two long strings')
def step_two_long_strings(context):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
random_str = lambda size: [random.choice(alphabet) for _ in range(0, size... | 3.046875 | 3 |
apis/custom_errors.py | gusibi/Metis | 84 | 12798265 | <reponame>gusibi/Metis
# -*- coding: utf-8 -*-
###
### DO NOT CHANGE THIS FILE
###
### The code is auto generated, your change will be overwritten by
### code generating.
###
from sanic.exceptions import SanicException
def add_status_code(code):
"""
Decorator used for adding exceptions to _sanic_exceptions.... | 1.96875 | 2 |
telewavesim/utils.py | mtoqeerpk/Telewavesim | 0 | 12798266 | <filename>telewavesim/utils.py
# Copyright 2019 <NAME>
# This file is part of Telewavesim.
# 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 ... | 1.742188 | 2 |
pdx_beer_finder/beer_googles/models.py | mgborgman/pcg2015_mgb | 0 | 12798267 | <filename>pdx_beer_finder/beer_googles/models.py
from django.db import models
from django.contrib.auth.models import User
class Beer(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
slug = models.SlugField(unique=True, default='')
def __unicode__(self):
... | 2.328125 | 2 |
JoystickInput/JoystickServer.py | Mnenmenth/RobotCode | 0 | 12798268 | from serial import Serial
import time
import platform
import socket
serialPort = Serial('COM3' if platform.system() == 'Windows' else '/dev/ttyUSB0', 9600)
time.sleep(2)
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('', 2222))
server.listen(1)
while True:
(client, address) = server.accept(... | 2.71875 | 3 |
app/api/v1/stu/teacher_class.py | Hansybx/guohe3 | 1 | 12798269 | <filename>app/api/v1/stu/teacher_class.py
"""
-*- coding: utf-8 -*-
Time : 2019/7/27 16:15
Author : Hansybx
"""
from flask import request, jsonify
from app.api.v1.stu import stu
from app.models.error import PasswordFailed
from app.models.res import Res
from app.utils.teacher_class.teacher_class_utils import get... | 2.640625 | 3 |
process_html.py | weepingwillowben/web-script-wars | 1 | 12798270 | <reponame>weepingwillowben/web-script-wars<gh_stars>1-10
import base64
from jinja2 import Template
import sys
import os
import urllib.request
def encodebase64(filename):
fin = open(filename, 'rb')
contents = fin.read()
data_url = base64.b64encode(contents)
fin.close()
return data_url.decode("utf-8"... | 2.703125 | 3 |
setup.py | litrin/MACD | 13 | 12798271 | <filename>setup.py
from distutils.core import setup
setup(
name='MACD',
version='1.0',
py_modules=["Average", "MACD"],
license='MIT',
author='<NAME>',
author_email='<EMAIL>'
)
| 1.070313 | 1 |
hplusminus/sid.py | bio-phys/hplusminus | 1 | 12798272 | <filename>hplusminus/sid.py
# Copyright (c) 2020 <NAME>, Max Planck Institute of Biophysics, Frankfurt am Main, Germany
# Released under the MIT Licence, see the file LICENSE.txt.
import os
import numpy as np
from scipy.stats import gamma as gamma_dist
import scipy
def _get_package_gsp():
"""
Return the dire... | 2.375 | 2 |
book/form.py | GyanendraMaurya/book-recommendation-system | 0 | 12798273 | from django.forms import ModelForm, Textarea, TextInput
from .models import Review
from django import forms
from django.contrib.auth.models import User
# Form to take display to take user's review
class ReviewForm(ModelForm):
class Meta:
model = Review
fields = ['rating', 'comment']
#user_... | 2.25 | 2 |
app.py | DanielNery/vagas-emprego-flask-api | 0 | 12798274 | <gh_stars>0
from flask import Flask
from flask_restful import Api
from resources.vagas import VagasEmpregoResource
App = Flask(__name__)
App.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///banco.db'
App.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
Api = Api(App)
# Vai criar o banco e todas aas suas tabelas
@App... | 2.4375 | 2 |
item_engine/textbase/__init__.py | GabrielAmare/ItemEngine | 0 | 12798275 | from item_engine import *
from .constants import *
from .items import *
from .functions import *
from .base_materials import *
from .materials import *
from .operators import *
from .display import *
from .setup import *
| 1.101563 | 1 |
output/models/sun_data/ctype/derivation_method/derivation_method00102m/derivation_method00102m2_xsd/derivation_method00102m2.py | tefra/xsdata-w3c-tests | 1 | 12798276 | <reponame>tefra/xsdata-w3c-tests
from dataclasses import dataclass, field
from typing import Optional
__NAMESPACE__ = "derivationMethod"
@dataclass
class A1:
class Meta:
name = "A"
value: Optional[int] = field(
default=None,
metadata={
"required": True,
}
)
... | 2.234375 | 2 |
models.py | ethanabrooks/jax-rl | 0 | 12798277 | from flax import nn
import jax
from haiku._src.typing import PRNGKey
from jax import random
import jax.numpy as jnp
import numpy as onp
from typing import List, Tuple
from utils import gaussian_likelihood
class TD3Actor(nn.Module):
def apply(self, x, action_dim, max_action):
x = nn.Dense(x, features=256)... | 2.09375 | 2 |
bootcamp/authentication/admin.py | ChowBu/bootcamp | 0 | 12798278 | <reponame>ChowBu/bootcamp
from django.contrib import admin
from bootcamp.authentication.models import Profile
@admin.register(Profile)
class ProfileAdmin(admin.ModelAdmin):
# 不能添加tags 会出错,暂时不管
# list_display = ('id','user','location', 'url','job_title',)
# search_fields = ('user','location', 'url','job_tit... | 2.09375 | 2 |
tests/test_anagram.py | npcasler/anagram | 0 | 12798279 | # Anagram Utility
# License: MIT
""" Tests for anagram"""
import unittest
import errno
import shutil
from os.path import join
import anagram.anagram as anagram
class TestAnagram(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.parser = anagram.args_options()
cls.mock_path = '/path/to/folder'
@clas... | 3.328125 | 3 |
moulin/builders/android_kernel.py | Deedone/moulin | 0 | 12798280 | # SPDX-License-Identifier: Apache-2.0
# Copyright 2021 EPAM Systems
"""
Android kernel builder module
"""
import os.path
from typing import List
from moulin.yaml_wrapper import YamlValue
from moulin import ninja_syntax
def get_builder(conf: YamlValue, name: str, build_dir: str, src_stamps: List[str],
... | 2.125 | 2 |
backend/lk/logic/websites.py | Purus/LaunchKitDocker | 2,341 | 12798281 | <gh_stars>1000+
# encoding: utf-8
#
# Copyright 2016 Cluster Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 1.5625 | 2 |
plumeria/config/common.py | sk89q/plumeria | 18 | 12798282 | <filename>plumeria/config/common.py<gh_stars>10-100
"""A list of common configuration options that might be used by plugins."""
from functools import wraps
from plumeria import config
from plumeria.command import CommandError
from plumeria.config.types import boolstr, dateformatstr
from plumeria.core.scoped_config imp... | 2.3125 | 2 |
tests/test_totalchance.py | sponsfreixes/dice_stats | 2 | 12798283 | from fractions import Fraction
from dice_stats import Dice
def test_totalchance():
d6 = Dice.from_dice(6)
for c in [
Fraction(1),
Fraction(1, 2),
Fraction(1, 6),
]:
assert d6 @ c * 2 == 2 * d6 @ c
def test_nested_d6():
d6 = Dice.from_dice(6)
d6_a = Dice.sum(v * ... | 3.28125 | 3 |
datasets/sult_model/fetch_smiles.py | ssirimulla/openDMPK | 17 | 12798284 | <gh_stars>10-100
# Script to fetch smiles using chembl id
# Source: https://www.ebi.ac.uk/chembl/ws
# For monkey patching (necessary?)
# import gevent.monkey
# gevent.monkey.patch_all()
# from requests.packages.urllib3.util.ssl_ import create_urllib3_context
# create_urllib3_context()
from chembl_webresource_client.... | 2.359375 | 2 |
python/sqlflow_submitter/pai/model.py | pake35/sqlflow | 1 | 12798285 | # Copyright 2019 The SQLFlow 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 applicable law o... | 2.125 | 2 |
houdini_manage/library.py | NiklasRosenstein/houdini-manage | 7 | 12798286 | # Copyright (C) 2017 <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, copy, modify, merge, publish, distribute,... | 1.882813 | 2 |
code/waldo/prepare/summarize.py | amarallab/waldo | 0 | 12798287 | from __future__ import print_function, absolute_import, unicode_literals, division
import six
from six.moves import (zip, filter, map, reduce, input, range)
# standard library
import functools
# third party
# project specific
from waldo.conf import settings
from waldo import wio
from . import secondary
from . import... | 1.984375 | 2 |
ismore/invasive/sim_passive_movement.py | DerekYJC/bmi_python | 0 | 12798288 | import numpy as np
import socket, struct
from ismore import settings, udp_feedback_client
import time
from ismore import common_state_lists, ismore_bmi_lib
import pandas as pd
import pickle
import os
class Patient(object):
def __init__(self, targets_matrix_file):
self.addrs = [settings.ARMASSIST_UDP_SERVE... | 2.078125 | 2 |
batchglm/train/tf/base_glm_all/estimator_graph.py | SabrinaRichter/batchglm | 0 | 12798289 | <reponame>SabrinaRichter/batchglm
from typing import Union
import logging
import tensorflow as tf
import numpy as np
import xarray as xr
from .external import GradientGraphGLM, NewtonGraphGLM, TrainerGraphGLM
from .external import EstimatorGraphGLM, FullDataModelGraphGLM, BatchedDataModelGraphGLM
from .external impor... | 2.5 | 2 |
tno/mpc/encryption_schemes/utils/utils.py | TNO-MPC/encryption_schemes.utils | 0 | 12798290 | """
Useful functions for creating encryption schemes.
"""
from math import gcd
from typing import Tuple
import sympy
from ._check_gmpy2 import USE_GMPY2
if USE_GMPY2:
import gmpy2
def randprime(low: int, high: int) -> int:
"""
Generate a random prime number in the range [low, high). Returns GMPY2 MPZ ... | 3.90625 | 4 |
src/mbed_cloud/_backends/enrollment/models/bulk_create_response.py | GQMai/mbed-cloud-sdk-python | 12 | 12798291 | <reponame>GQMai/mbed-cloud-sdk-python
# coding: utf-8
"""
Enrollment API
Mbed Cloud Connect Enrollment Service allows users to claim the ownership of a device which is not yet assigned to an account. A device without an assigned account can be a device purchased from the open market (OEM dealer) or a device t... | 2.03125 | 2 |
nets/vgg16.py | bubbliiiing/classification-pytorch | 88 | 12798292 | import torch
import torch.nn as nn
from torchvision.models.utils import load_state_dict_from_url
model_urls = {
'vgg16': 'https://download.pytorch.org/models/vgg16-397923af.pth',
}
class VGG(nn.Module):
def __init__(self, features, num_classes=1000, init_weights=True):
super(VGG, self).__i... | 2.59375 | 3 |
data-detective-airflow/data_detective_airflow/test_utilities/test_helper.py | dmitriy-e/metadata-governance | 5 | 12798293 | <reponame>dmitriy-e/metadata-governance
"""Helper for creating DAG tests
"""
import logging
from typing import Any, Union
import petl
from airflow.models import BaseOperator, TaskInstance
from airflow.utils import timezone
from pandas import DataFrame
from pytest_mock.plugin import MockerFixture
from data_detective_a... | 2.03125 | 2 |
fast_tmp/apps/api/__init__.py | Chise1/fast-tmp2 | 1 | 12798294 | from datetime import timedelta
from fastapi import Form
from fastapi.security import OAuth2PasswordRequestForm
from fastapi import Depends, HTTPException
from pydantic import BaseModel
from starlette import status
from starlette.requests import Request
from fast_tmp.apps.api.schemas import LoginR
from fast_tmp.depend... | 2.15625 | 2 |
algorithms/dqn.py | GambuzX/sokoban-rl | 0 | 12798295 | import gym
import gym_sokoban
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines.deepq.policies import MlpPolicy
from stable_baselines import DQN
def run():
# hyperparameters
gamma = 0.99 #discount factor
learning_rate = 0.00025 #learning rate for adam optimizer
buffer_size ... | 2.390625 | 2 |
Python/hardware/Arms.py | marcostrullato/RoobertV2 | 0 | 12798296 | #!/usr/bin/env python
# Roobert V2 - second version of home robot project
# ________ ______ _____
# ___ __ \______________ /_______________ /_
# __ /_/ / __ \ __ \_ __ \ _ \_ ___/ __/
# _ _, _// /_/ / /_/ / /_/ / __/ / / /_
# /_/ |_| \____/\____//... | 1.773438 | 2 |
PyPoll/main.py | v33na/python-challenge | 0 | 12798297 | <gh_stars>0
# Modules
import os
import csv
#Set the variables
total_votes = 0
total_candidates = 0
candidates_names = []
candidate_votes = []
# Winning Candidate and Winning Count Tracker
percent = []
# Set path for file
poll_path = os.path.join("Resources", "election_data.csv")
output_path = os.path.jo... | 3.546875 | 4 |
receivers/utils.py | cosnomi/smart-mail-slacker | 0 | 12798298 | <gh_stars>0
from datetime import datetime
class MessageData:
keys = [('internal_date', datetime), ('subject', str), ('body', str),
('from', list), ('to', list)]
def __init__(self, params):
for key, expected_type in self.keys:
if not key in params:
rai... | 2.796875 | 3 |
code/backend/billing/services.py | rollethu/noe | 16 | 12798299 | <gh_stars>10-100
from typing import List
from collections import defaultdict
import logging
from django.conf import settings
from online_payments.billing.enums import Currency
from online_payments.billing.models import Item, PaymentMethod, Invoice, Customer
from online_payments.billing.szamlazzhu import Szamlazzhu
from... | 1.976563 | 2 |
lb_colloids/Colloids/Colloid_output.py | jdlarsen-UA/LB-colloids | 1 | 12798300 | """
The Colloid_output module contains classes to read LB Colloids simulation
outputs and perform post processing. Many classes are available to
provide plotting functionality. ModelPlot and CCModelPlot are useful for
visualizing colloid-surface forces and colloid-colloid forces respectively.
example import of the Col... | 3.375 | 3 |
tests/parse_fragment_unit_tests.py | Wynjones1/pycompile | 0 | 12798301 | import unittest
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
from src import parser
from src import ast
class ParserTestCase(unittest.TestCase):
def assertParsesTo(self, func, data, type_):
self.assertIsInstance(parser.parse(data, func), type_)
class Test_parse_fra... | 3.015625 | 3 |
scripts/leviosam_utils.py | maxrossi91/levioSAM | 23 | 12798302 | <filename>scripts/leviosam_utils.py
'''
Utils for levioSAM
<NAME>
Johns Hopkins University
2021
'''
import pysam
'''
Read a FASTA file as a dict if a file name is given. If not, return an empty dict.
'''
def read_fasta(ref_fn: str) -> dict:
ref = {}
if ref_fn != '':
f = pysam.FastaFile(ref_fn)
... | 2.734375 | 3 |
conf/path_config.py | atom-zh/SA_Classification | 2 | 12798303 | # -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/6/5 21:04
# @author :Mo
# @function :file of path
import os
# 项目的根目录
path_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
path_root = path_root.replace('\\', '/')
# train out
path_out = path_root + "/out/"
# path of embedding
... | 2.3125 | 2 |
12403/save_setu.py | sc458/uHunt-solutions | 0 | 12798304 | res = 0
T = int(input())
for i in range(0,T):
inp = input()
if(inp == 'report'):
print(res)
else:
inp_arr = inp.split(' ')
res += int(inp_arr[1])
| 3.421875 | 3 |
config.py | ajith-ramanath/AzureCognitiveSearch | 0 | 12798305 | <gh_stars>0
from os import environ as env
from azure.identity import ClientSecretCredential
from azure.keyvault.secrets import SecretClient
__tenant_id = env.get("AZURE_TENANT_ID", "")
__client_id = env.get("AZURE_CLIENT_ID", "")
__client_secret = env.get("AZURE_CLIENT_SECRET", "")
__key_vault_name = env.get("AZURE_KE... | 2.125 | 2 |
isimip_data/caveats/tests/test_admin.py | ISI-MIP/isimip-data | 3 | 12798306 | <filename>isimip_data/caveats/tests/test_admin.py<gh_stars>1-10
from django.conf import settings
from django.core import mail
from django.urls import reverse
from isimip_data.caveats.models import Caveat, Comment
def test_annotation_add_get(db, client):
client.login(username='admin', password='<PASSWORD>')
u... | 2.15625 | 2 |
backend/common/tests.py | marcosflp/commitz | 1 | 12798307 | from rest_framework.authtoken.models import Token
from rest_framework.test import APITestCase
from users.models import User, GitHubProfile
class BaseTestCase(APITestCase):
USER = 'admin'
PASSWORD = '<PASSWORD>'
EMAIL = '<EMAIL>'
def setUp(self):
super(BaseTestCase, self).setUp()
user... | 2.0625 | 2 |
docs/examples/ckan.py | Defra-Data-Science-Centre-of-Excellence/sdg-build | 7 | 12798308 | """
This is an example of importing data from a CKAN instance and converting it
into the JSON output suitable for the Open SDG reporting platform.
"""
import os
import sdg
import pandas as pd
# Input data from CKAN
endpoint = 'https://inventory.data.gov/api/action/datastore_search'
indicator_id_map = {
# The reso... | 2.984375 | 3 |
prep_pop_points.py | ITDP/two_step_access | 1 | 12798309 | import geopandas as gpd
# required for MAUP: https://github.com/geopandas/geopandas/issues/2199
gpd.options.use_pygeos = False
import pandas as pd
import numpy as np
import shapely
import shapely.geometry
from shapely.geometry import Polygon, Point
from tqdm import tqdm
import maup
import os
#INTRO - need to edit valu... | 2.296875 | 2 |
examples/Lists.py | mnishitha/INF502-Fall2020 | 8 | 12798310 | <reponame>mnishitha/INF502-Fall2020
list_of_numbers = [1,2,3,4,5]
len(list_of_numbers)
list_of_numbers[0]
print(list_of_numbers)
list_of_numbers[4]
print(list_of_numbers)
list_of_numbers[-2]
print(list_of_numbers)
#extending it
list_of_numbers.extend([6,7,8])
print(list_of_numbers)
#slicing it
piece = list_of_numbers[... | 4.03125 | 4 |
backend/app/company/permissions.py | adithyanps/djangoAuthorization | 0 | 12798311 | from rest_framework import permissions
BASE_SAFE_METHODS = ['GET','HEAD','OPTIONS']
MEDIUM_SAFE_METHODS = ['GET', 'PUT','PATCH','HEAD','OPTIONS']
TOP_SAFE_METHODS = ['GET','DELETE','PUT','PATCH','HEAD','OPTIONS']
class Permission(permissions.BasePermission):
"""manage permissions based on user choice"""
def ... | 2.640625 | 3 |
lib/fama/pe_functional_pipeline.py | aekazakov/FamaProfiling | 0 | 12798312 | <reponame>aekazakov/FamaProfiling
"""Runs Fama functional profiling pipeline"""
import os
import gzip
from fama.utils.const import ENDS, STATUS_GOOD
from fama.se_functional_pipeline import run_fastq_pipeline
from fama.utils.utils import run_external_program
from fama.project.sample import Sample
from fama.diamond_pars... | 2.140625 | 2 |
Python3/1287.py | rakhi2001/ecom7 | 854 | 12798313 | <reponame>rakhi2001/ecom7
__________________________________________________________________________________________________
sample 76 ms submission
class Solution:
def findSpecialInteger(self, arr: List[int]) -> int:
for idx, num in enumerate(arr):
if arr[idx] == arr[idx+len(arr)//4]: return nu... | 2.703125 | 3 |
IntroProblems/Permutations/source.py | 0x5eba/CSES-solutions | 27 | 12798314 | N=int(input())
if N==4:print("2 4 1 3");exit()
if N==1:print("1");exit()
if N<4:print("NO SOLUTION");exit()
[print(i) for i in range(1,N+1,2)]
[print(i) for i in range(2,N+1,2)]
| 3.46875 | 3 |
8 kyu/Remove First and Last Character.py | mwk0408/codewars_solutions | 6 | 12798315 | <filename>8 kyu/Remove First and Last Character.py
def remove_char(s):
s2=s[1:len(s)-1]
return s2 | 3.40625 | 3 |
laas/actions/actions/parse_network_data.py | opnfv/laas-reflab | 1 | 12798316 | ##############################################################################
# Copyright 2018 <NAME> and Others #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not ... | 2.140625 | 2 |
serving_agent/model_agent.py | HughWen/ServingAgent | 19 | 12798317 | import time
import pickle
import redis
class ModelAgent:
def __init__(
self,
redis_broker='localhost:6379',
redis_queue='broker',
model_class=None,
model_config={},
batch_size=64,
model_sleep=0.1,
collection=False,
collection_limit=6000,
... | 2.1875 | 2 |
nautobot_golden_config/utilities/graphql.py | chadell/nautobot-plugin-golden-config | 0 | 12798318 | <filename>nautobot_golden_config/utilities/graphql.py<gh_stars>0
"""Example code to execute GraphQL query from the ORM."""
import logging
from django.utils.module_loading import import_string
from graphene_django.settings import graphene_settings
from graphql import get_default_backend
from graphql.error import Graph... | 2.53125 | 3 |
etc/tf_tutorial/Tensorflow-101-master/cnn_mnist_simple.py | zhangbo2008/facenet | 0 | 12798319 | #!/usr/bin/env python
# coding: utf-8
# ## SIMPLE CONVOLUTIONAL NEURAL NETWORK
# In[1]:
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
get_ipython().run_line_magic('matplotlib', 'inline')
print ("PACKAGES LOADED")
# # LOAD MNIS... | 3.234375 | 3 |
src/view/view_analisys.py | jcemelanda/PyGPA2.0 | 0 | 12798320 | <filename>src/view/view_analisys.py
from PyQt4 import QtGui, QtCore
from widgets.window_analisys import Analysis_Window
class Analise_View(QtGui.QMainWindow):
def __init__(self, controle):
QtGui.QMainWindow.__init__(self)
self.controle = controle
self.ui = Analysis_Window()
self.ui.... | 2.359375 | 2 |
M1/Aula1.py | DouglasCarvalhoPereira/Interact-OS-PYTHON | 0 | 12798321 | <reponame>DouglasCarvalhoPereira/Interact-OS-PYTHON<filename>M1/Aula1.py
name = input('Digite se nome: ')
cont = 0
while cont < 10:
print(f'Hello word {name}')
cont+=1 | 3.15625 | 3 |
Sudoku.py | lavieduynguyen/Sudoku | 0 | 12798322 | import kivy
kivy.require('1.10.0')
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.checkbox import CheckBox
from kivy.uix.dropdown import DropDown
from kivy.uix.gridlayout import GridLayout
from kivy.uix.screenmanager import Screen, ScreenManager
from sudokub... | 2.984375 | 3 |
src/bfg/module.py | rvrsh3ll/bl-bfg | 6 | 12798323 | import argparse
import inspect
import re
def bindSignatureArgs(func, src:dict) -> dict:
'''
Args:
func: Function/method from which the signature will be sourced.
src: Source dictionary that will provide values for dest.
Returns:
A new dictionary with argument values from src set
... | 3.125 | 3 |
oraexec.py | bakink/oracle-imagecopy-backup | 20 | 12798324 | import os, sys
from subprocess import Popen, PIPE
from backupcommon import BackupLogger, info, debug, error, exception
from datetime import datetime, timedelta
from tempfile import mkstemp, TemporaryFile
class OracleExec(object):
oraclehome = None
tnspath = None
oraclesid = None
def __init__(self, ora... | 2.328125 | 2 |
example/XGB.py | abhineet123/paramparse | 0 | 12798325 | class XGB:
class Params:
def __init__(self):
self.max_depth = 2
self.eta = 1
self.objective = 'binary:logistic'
self.nthread = 4
self.eval_metric = 'auc'
self.num_round = 10
self.verbose = 1
self.help = {
}
| 2.078125 | 2 |
final_project/main.py | DroogieDroog/python | 0 | 12798326 | <filename>final_project/main.py<gh_stars>0
"""
pirple/python/final_project/main.py
Final Project
Create a Go Fish game
"""
from random import (shuffle, randint)
from time import sleep
from os import system, name
class Player:
def __init__(self, name, computer = False):
self.Name = name
self.Comp... | 3.875 | 4 |
micadoparser/parser.py | micado-scale/micado-parser | 0 | 12798327 | <filename>micadoparser/parser.py
import logging
from toscaparser.tosca_template import ToscaTemplate
from toscaparser.common.exception import ValidationError as TOSCAParserError
from yaml.error import YAMLError
from micadoparser import validator
from micadoparser.exceptions import ValidationError
from micadoparser.ut... | 2.5 | 2 |
database.py | Anve94/DiscordBot-public | 0 | 12798328 | <reponame>Anve94/DiscordBot-public
import os
import sys
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
Base = declarative_base()
# Abuser class to insert people abusing the bugreporting feature
class Abus... | 2.4375 | 2 |
speech_recognition/cmusphinx-code/sphinxtrain/python/cmusphinx/fstutils.py | Ohara124c41/TUB-MSc_Thesis | 1 | 12798329 | <reponame>Ohara124c41/TUB-MSc_Thesis<filename>speech_recognition/cmusphinx-code/sphinxtrain/python/cmusphinx/fstutils.py
#!/usr/bin/env python
# Copyright (c) 2010 Carnegie Mellon University
#
# You may copy and modify this freely under the same terms as
# Sphinx-III
"""
FST utility functions
"""
__author__ = "<NAM... | 2.125 | 2 |
python/lab/ref.py | tao12345666333/Talk-Is-Cheap | 4 | 12798330 | #!/usr/bin/env python
# coding=utf-8
def add(a, b):
return a + b
c = add(288, 500)
| 2.390625 | 2 |
tests/testconfig.py | neurosis69/chia-blockchain | 0 | 12798331 | <gh_stars>0
from __future__ import annotations
from typing import List, Union
from typing_extensions import Literal
Oses = Literal["macos", "ubuntu", "windows"]
# Github actions template config.
oses: List[Oses] = ["macos", "ubuntu", "windows"]
# Defaults are conservative.
parallel: Union[bool, int, Literal["auto"]... | 1.8125 | 2 |
example/rcnn/rcnn/metric.py | Liuxg16/BrainMatrix | 4 | 12798332 | import mxnet as mx
import numpy as np
from rcnn.config import config
class LogLossMetric(mx.metric.EvalMetric):
def __init__(self):
super(LogLossMetric, self).__init__('LogLoss')
def update(self, labels, preds):
pred_cls = preds[0].asnumpy()
label = labels[0].asnumpy().astype('int32'... | 2.328125 | 2 |
mblogger/soa_app_ml/soa_app_ml.py | mlatcl/fbp-vs-oop | 6 | 12798333 | <reponame>mlatcl/fbp-vs-oop
import requests
from mblogger.record_types import *
base_url = 'http://127.0.0.1:5000/'
class App():
def evaluate(self):
followers = self._get_followers()
followings = self._get_followings()
timelines = self._get_timelines()
generated_posts = self._ge... | 2.71875 | 3 |
conv/inc/data_class.py | Kdy0115/simulation | 0 | 12798334 | import pandas as pd
import os
class DataFile:
# 1日分のデータが格納された辞書
data_files = {}
def __init__(self,df,filepath,outpath,kind):
# 1ファイルの内容
self.df = df
# 入力ファイルパス
self.filename = filepath
# 出力先パス
self.output_dir = outpath
# データの種類
self.data_kind... | 3.109375 | 3 |
molecules/ml/unsupervised/vae/vae.py | hengma1001/molecules | 0 | 12798335 | <reponame>hengma1001/molecules<filename>molecules/ml/unsupervised/vae/vae.py
import torch
from torch import nn
from torch.nn import functional as F
from .resnet import ResnetVAEHyperparams
from .symmetric import SymmetricVAEHyperparams
from molecules.ml.hyperparams import OptimizerHyperparams, get_optimizer
__all__ = ... | 2.109375 | 2 |
tests/test_all.py | avidale/compress-fasttext | 111 | 12798336 | import os
import gensim
import pytest
import compress_fasttext
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import LogisticRegression
from compress_fasttext.feature_extraction import FastTextTransformer
BIG_MODEL_FILE = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data/test_data/f... | 2.375 | 2 |
URI/1-Beginner/1074.py | vicenteneto/online-judge-solutions | 0 | 12798337 | # -*- coding: utf-8 -*-
for i in range(int(raw_input())):
x = int(raw_input())
if x == 0:
print 'NULL'
elif x < 0:
if x % 2 == 0:
print 'EVEN NEGATIVE'
else:
print 'ODD NEGATIVE'
else:
if x % 2 == 0:
print 'EVEN POSITIVE'
else:... | 4.125 | 4 |
tests/parser_test.py | malanb5/py_requirements_installer | 0 | 12798338 | import unittest, yaml
from pyreqgen.ReqParser import *
class TestParser(unittest.TestCase):
def test_files(self):
with open("../config.yaml", 'r+') as config_f:
configs = yaml.load(config_f, Loader=yaml.FullLoader)
print(configs)
py_files = ReqParser.__get_py_files(configs)
reqs = ReqParser.__get_reqs(... | 2.640625 | 3 |
xcparse/Xcode/xcscheme.py | samdmarshall/xcparser | 59 | 12798339 | import os
import sys
import xml.etree.ElementTree as xml
from ..Helpers import path_helper
from ..Helpers import xcrun_helper
from ..Helpers import logging_helper
from .XCSchemeActions.BuildAction import BuildAction
from .XCSchemeActions.TestAction import TestAction
from .XCSchemeActions.LaunchAction import LaunchAct... | 2.046875 | 2 |
itk_invitations/migrations/0001_initial.py | eric-scott-owens/loopla | 0 | 12798340 | <filename>itk_invitations/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-09 18:33
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import localflavor.us.models
class Migration... | 1.640625 | 2 |
tests/__init__.py | Nazze/ha_best_bottrop_garbage_collection | 0 | 12798341 | """Tests for the BEST bottrop custom component."""
| 1.125 | 1 |
src/basics.py | dandjo/tensorflow-playground | 0 | 12798342 | <reponame>dandjo/tensorflow-playground
import tensorflow as tf
node1 = tf.constant(3.0, tf.float32)
node2 = tf.constant(4.0)
print(node1) # Tensor("Const:0", shape=(), dtype=float32)
print(node2) # Tensor("Const_1:0", shape=(), dtype=float32)
node3 = node1 * node2
print(node3) # Tensor("mul:0", shape=(), dtype=f... | 3.0625 | 3 |
dedupsqlfs/app/actions/recompress.py | tabulon-ext/dedupsqlfs | 22 | 12798343 | # -*- coding: utf8 -*-
"""
Special action to recompress all data
"""
__author__ = 'sergey'
import sys
from multiprocessing import cpu_count
def do_recompress(options, _fuse):
"""
@param options: Commandline options
@type options: object
@param _fuse: FUSE wrapper
@type _fuse: dedupsqlfs.fuse.... | 2.3125 | 2 |
get_positions.py | gregorytadams/Model_UN | 0 | 12798344 | # get_positions.py
import pandas as pd
from math import ceil
from sys import argv
'''
Current known problems:
- do schools at different times (ew)
- Bias towards double delegate committees
'''
class Team:
def __init__(self, name, num_delegates, preferences):
'''
num_delegats is an int of the ... | 3.125 | 3 |
settingsmanager/base.py | rgossington/settings-manager | 0 | 12798345 | import re
class BaseClass:
def _get_keys(self):
attrs = self.get_attributes()
return attrs.keys()
def get_attributes(self):
attrs = self.__dict__
attrs_filtered = {k: v for k, v in attrs.items() if not k.startswith("_")}
return attrs_filtered
@staticmethod
def... | 2.9375 | 3 |
src/database/querys/clients.py | g4-mobile/g4-mobile-api | 0 | 12798346 | <filename>src/database/querys/clients.py
from typing import List
from src.database import DBConnectionHendler
from src.database.db_connection import db_connector
from src.database.models import Client
class ClientQuerys:
"""Criando um novo cliente"""
@classmethod
def new(cls, nome):
"""someting"... | 2.84375 | 3 |
tests/unit/test_bucket.py | Kapuca/ccxt_microservice | 0 | 12798347 | from ccxt_microservice.bucket import Bucket
import pytest
@pytest.fixture
def the_bucket():
return Bucket(10, 1, 5)
def test_state(the_bucket):
assert 4.99 < the_bucket.state() < 5
def test_push(the_bucket):
the_bucket.push(5)
assert 9.99 < the_bucket.state() < 10
def test_timeToWait(the_bucket):... | 2.125 | 2 |
logL.py | mkherman/HRS-logL | 1 | 12798348 | """
Author: <NAME>
Created: 2020-10-28
Last Modified: 2021-05-11
Description: Calculates the 6-D log likelihood map for a series of atmospheric
models cross-correlated with planetary emission spectra. Parameters are log VMR,
day-night contrast, peak phase offset, scaled line contrast, orbital velocity,
and systemic v... | 2.625 | 3 |
entrypoint.py | vliz-be-opsci/rocrate-to-pages | 0 | 12798349 | #!/usr/bin/env python3
# NOTE: If you are using an alpine docker image
# such as pyaction-lite, the -S option above won't
# work. The above line works fine on other linux distributions
# such as debian, etc, so the above line will work fine
# if you use pyaction:4.0.0 or higher as your base docker image.
# Steps in t... | 1.984375 | 2 |
automatization_of_data_mining_project/data_set_statistic_reporter/test/test_data_set_statistic_reporter.py | Sale1996/automatization_of_data_mining_project | 0 | 12798350 | <filename>automatization_of_data_mining_project/data_set_statistic_reporter/test/test_data_set_statistic_reporter.py
import unittest
from data_set_statistic_reporter.classes.statistic_generator.implementations.column_names_statistic_generator import \
ColumnNamesStatisticGenerator
from data_set_statistic_reporter.... | 2.59375 | 3 |