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 |
|---|---|---|---|---|---|---|
settings/__init__.py | xuehuiping/DCA | 5 | 46500 | """Helpers to build the blocks of the training
pipeline for users defined parameters.
"""
from .setup_xp import load_params, set_device, get_embedders
from .model import build_multi_agt_summarizer
__all__ = [
"build_multi_agt_summarizer",
"load_params",
"set_device",
"get_embedders"
]
| 1.609375 | 2 |
relogic/logickit/serving/__init__.py | Impavidity/relogic | 24 | 46501 | <reponame>Impavidity/relogic<filename>relogic/logickit/serving/__init__.py
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/')
def index():
return jsonify("Hello World")
class Server(object):
def __init__(self, trainer=None):
self.trainer = trainer
def start(self):
app.run... | 2.0625 | 2 |
neupy/layers/connections/graph.py | vishalbelsare/neupy | 0 | 46502 | import copy
import pprint
import inspect
from collections import OrderedDict
import six
from neupy.exceptions import LayerConnectionError
__all__ = ('LayerGraph',)
def filter_list(iterable, include_values):
"""
Create new list that contains only values
specified in the ``include_values`` attribute.
... | 2.578125 | 3 |
lsassy/dumpmethod/rdrleakdiag.py | kaisaryousuf/lsassy | 4 | 46503 | from lsassy.dumpmethod import IDumpMethod
class DumpMethod(IDumpMethod):
def __init__(self, session, timeout):
super().__init__(session, timeout)
self.waiting_time = 5
def prepare(self, options):
self.waiting_time = options.get("rdrleakdiag_wait", self.waiting_time)
return Tru... | 2.15625 | 2 |
kaolin/metrics/point.py | Bob-Yeah/kaolin | 2 | 46504 | # Copyright (c) 2019, 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 applic... | 2.640625 | 3 |
mnist_cwgangp.py | hari2095/GAN | 0 | 46505 | import argparse
import sys
import torch
from inferno.trainers.basic import Trainer
from inferno.trainers.callbacks.logging.tensorboard import TensorboardLogger
from torch import nn
from torch.autograd import Variable
from torch.utils.data.dataloader import DataLoader
from torch.utils.data.dataset import Dataset
from t... | 2.140625 | 2 |
lastweekend_photos/apps/photo_gallery/rest_api/filters.py | OmidFarvid/lastweekend-photos | 0 | 46506 | <filename>lastweekend_photos/apps/photo_gallery/rest_api/filters.py<gh_stars>0
import django_filters
from django_filters import rest_framework as filters
# from apps.photo_gallery.models import Event
#
#
# class EventFilter(filters.FilterSet):
# start_date_min = django_filters.DateFilter(field_name='start_date', l... | 1.765625 | 2 |
data_processor.py | ZouJoshua/deeptext_project | 2 | 46507 | #!/usr/bin/env python
# coding:utf8
# Copyright (c) 2018, Tencent. All rights reserved
# This file contain DataProcessor class which can
# 1. Generate dict from train text data:
# Text format: label\t[(token )+]\t[(char )+]\t[(custom_feature )+].
# Label could be flattened or hierarchical which is separat... | 2.671875 | 3 |
utils/processing/dataset.py | SecureThemAll/CquenceR | 0 | 46508 | <reponame>SecureThemAll/CquenceR
from sklearn.model_selection import train_test_split
from pandas import DataFrame
SPLIT_RATIOS = (0.85, 0.1, 0.05)
def train_val_test_split(dataset: DataFrame, shuffle: bool = True) -> dict:
train, test = train_test_split(dataset, test_size=1 - SPLIT_RATIOS[0], shuffle=shuffle)
... | 2.9375 | 3 |
openerp/addons/web_diagram/__openerp__.py | ntiufalara/openerp7 | 3 | 46509 | {
'name': 'OpenERP Web Diagram',
'category': 'Hidden',
'description': """
Openerp Web Diagram view.
=========================
""",
'version': '2.0',
'depends': ['web'],
'js': [
'static/lib/js/raphael.js',
'static/lib/js/jquery.mousewheel.js',
'static/src/js/vec2.js',
... | 0.941406 | 1 |
abc/166/A.py | tonko2/AtCoder | 2 | 46510 | <reponame>tonko2/AtCoder
contests = ['ABC', 'ARC']
S = input()
contests.remove(S)
print(contests[0]) | 2.90625 | 3 |
Xiuzhen_MongoDB.py | cby3149/Novel_sender | 0 | 46511 | <filename>Xiuzhen_MongoDB.py
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
import smtplib
from email.mime.text import MIMEText
import time
import pymongo
#-------------------------------------------------
client = pymongo.MongoClient()
db = client.noval
collection = db.xiuzhen
#-----------------... | 2.609375 | 3 |
storops/vnx/xmlapi_parser.py | tunaruraul/storops | 60 | 46512 | <reponame>tunaruraul/storops<gh_stars>10-100
# coding=utf-8
# Copyright (c) 2015 EMC 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
#
# h... | 2.03125 | 2 |
stop_words.py | prateekguptaiiitk/Natural_Language_Processing | 0 | 46513 | from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
text = "This is an example sentence for showing stop words filteration."
stop_words = set(stopwords.words("english"))
# all the stop words of englist language defined in nltk
# print(stop_words)
words = word_tokenize(text)
filtered_sentence ... | 3.9375 | 4 |
prac/20200526/wrap.py | yaroslavKonst/PythonPracticum | 2 | 46514 | import sys
import subprocess
ex = sys.executable
print(subprocess.run([ex, sys.argv[1], *sys.argv[2:]], capture_output=True).stdout.decode("UTF-8"))
| 2.578125 | 3 |
hello.py | pangtouyu/flasky4a | 0 | 46515 | <gh_stars>0
from flask import Flask, render_template
from flask.ext.script import Manager
from flask.ext.bootstrap import Bootstrap
from flask.ext.moment import Moment
from flask.ext.wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
app = Flask(__name__)
app.config['S... | 2.578125 | 3 |
py/solns/longestPalindromicSubstr/longestPalindromicSubstr.py | zcemycl/algoTest | 1 | 46516 | <reponame>zcemycl/algoTest<gh_stars>1-10
class Solution:
def __init__(self):
self.res = ""
self.maxLen = 0
def naive(self,s):
self.length = len(s)
def loop(start,end):
l,r = start,end
while l>=0 and r<=self.length-1 and s[l]==s[r]:
if r-l+1... | 3.078125 | 3 |
crawler.py | langzeyu/book-crawler | 5 | 46517 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import hashlib
import urllib2
import urlparse
import zipfile
import logging
import re
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
from tornado import template
from BeautifulSoup import BeautifulSoup
from scrapy.selector import Html... | 2.140625 | 2 |
library/test/test_compiler/sbs_code_tests/95_annotation_global.py | creativemindplus/skybison | 278 | 46518 | # Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
def f():
(some_global): int
print(some_global)
# EXPECTED:
[
...,
LOAD_CONST(Code((1, 0))),
LOAD_CONST('f'),
MAKE_FUNCTION(0),
STORE_NAME('f'),
LOAD_CONST(None),
RETURN_VALUE(0),
CODE_START('f'),
~L... | 1.6875 | 2 |
BilgisiyarBilgisi.py | AlperN21/Python-Bilgisiyar-Bilgisi | 1 | 46519 | <gh_stars>1-10
#Buradaki bazı kısımlar açık kaynak kodlardır.
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
from xgboost import XGBClassifier
import xgboost as xgb
from sklearn.metr... | 2.65625 | 3 |
simple_dispatch/dispatch.py | ossdev07/SimpleDispatch | 0 | 46520 | from typing import Callable
_handlers = None
def connect(event_name: str, func: Callable):
"""
Connects a given function to be subscribed to the given event.
:param event_name: The name of the event to subscribe to.
:param func: The function that will be invoked when the event is published.
"""
... | 3.328125 | 3 |
python/helpers.py | DuckLov3r/sovrin-whs | 1 | 46521 | <filename>python/helpers.py
import base64
def serialize_bytes_json(data: bytes) -> str:
data_b64_encoded = base64.b64encode(data)
data_b64_encoded_str = data_b64_encoded.decode('utf-8')
return data_b64_encoded_str
def deserialize_bytes_json(b64_encoded: bytes) -> str:
b64_decoded = base64.b64decode(... | 2.90625 | 3 |
utils/synthetic_cell_nuclei_masks.py | stegmaierj/CellSynthesis | 1 | 46522 | # -*- coding: utf-8 -*-
"""
# 3D Image Data Synthesis.
# Copyright (C) 2021 <NAME>, <NAME>, <NAME>, <NAME>, <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 Liceense at
#
# http://www.apache.... | 1.96875 | 2 |
wb/main/scripts/get_system_resources.py | apaniukov/workbench | 23 | 46523 | <reponame>apaniukov/workbench
"""
OpenVINO DL Workbench
Script to getting system resources: CPU, RAM, DISK
Copyright (c) 2020 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... | 2.078125 | 2 |
src/chapter2/exercise8.py | group9BCS1/BCS-2021 | 1 | 46524 | #This program computes compound interest
#Prompt the user to input the inital investment
C = int(input('Enter the initial amount of an investment(C): '))
#Prompt the user to input the yearly rate of interest
r = float(input('Enter the yearly rate of interest(r): '))
#Prompt the user to input the number of years unti... | 4.25 | 4 |
george/basic.py | kastnerkyle/george | 1 | 46525 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["GP"]
try:
from itertools import izip
except ImportError:
izip = zip
import numpy as np
import scipy.optimize as op
from scipy.linalg import cho_factor, cho_solve, LinAlgError
from .utils import multivariate_gaussian_samples... | 2.265625 | 2 |
leetcode/lessons/array/370_range_addition/__init__.py | wangkuntian/leetcode | 0 | 46526 | <reponame>wangkuntian/leetcode
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__project__ = 'leetcode'
__file__ = '__init__.py.py'
__author__ = 'king'
__time__ = '2022/2/14 19:15'
_ooOoo_
o8888888o
88" . "88
... | 2.484375 | 2 |
movies_analyzer/RecommendationDataset.py | mateuszrusin/filmweb-rekomendacje | 3 | 46527 | from surprise.model_selection import train_test_split
from surprise.model_selection import LeaveOneOut
from surprise import KNNBaseline
from surprise import Dataset, KNNBasic
from surprise import Reader
import heapq
from movies_analyzer.Movies import Movies, RATINGS, LINKS, MOVIES
from movies_recommender.utils import ... | 2.921875 | 3 |
tests/unit/test_copr_build.py | FalseG0d/packit-service | 1 | 46528 | # MIT License
#
# Copyright (c) 2018-2019 Red Hat, Inc.
# 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, m... | 1.53125 | 2 |
test/test_backbone_utils.py | Gaurav7888/vision | 2 | 46529 | <reponame>Gaurav7888/vision
import torch
from torchvision.models.detection.backbone_utils import resnet_fpn_backbone
import pytest
@pytest.mark.parametrize('backbone_name', ('resnet18', 'resnet50'))
def test_resnet_fpn_backbone(backbone_name):
x = torch.rand(1, 3, 300, 300, dtype=torch.float32, device='cpu')
... | 2.375 | 2 |
paws/lib/python2.7/site-packages/requestbuilder-0.7.1-py2.7.egg/requestbuilder/mixins/formatting.py | cirobessa/receitas-aws | 0 | 46530 | <filename>paws/lib/python2.7/site-packages/requestbuilder-0.7.1-py2.7.egg/requestbuilder/mixins/formatting.py
# Copyright (c) 2012-2016 Hewlett Packard Enterprise Development LP
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that th... | 2.453125 | 2 |
python/examples/depthnet.py | jwkim386/Jetson_Inference | 5,788 | 46531 | <gh_stars>1000+
#!/usr/bin/python3
#
# Copyright (c) 2021, NVIDIA CORPORATION. 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 restriction, including without li... | 1.65625 | 2 |
misc/kwcheck.py | zzahti/skytools | 116 | 46532 | <reponame>zzahti/skytools
#! /usr/bin/env python
import sys
import re
import pkgloader
pkgloader.require('skytools', '3.0')
import skytools.quoting
kwmap = skytools.quoting._ident_kwmap
fn = "/opt/src/pgsql/postgresql/src/include/parser/kwlist.h"
if len(sys.argv) == 2:
fn = sys.argv[1]
rc = re.compile(r'PG_KEY... | 2.265625 | 2 |
remote-scripts/ConfigureDnsServer.py | xian123/azure-freebsd-automation | 1 | 46533 | <reponame>xian123/azure-freebsd-automation
#!/usr/bin/python
import argparse
import sys
from azuremodules import *
import paramiko
parser = argparse.ArgumentParser()
parser.add_argument('-D', '--vnetDomain_db_filepath', help='VNET Domain db filepath', required=True)
parser.add_argument('-r', '--vnetDomain_rev_filepath... | 1.828125 | 2 |
docs/conf.py | alancinacio/advanced-security-compliance | 83 | 46534 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 1.492188 | 1 |
tests/main.py | tdegeus/enstat | 0 | 46535 | import unittest
from collections import defaultdict
import numpy as np
import enstat.mean
class Test_mean(unittest.TestCase):
"""
tests
"""
def test_scalar(self):
"""
Basic test of "mean" and "std" using a random sample.
"""
average = enstat.scalar()
averag... | 3.453125 | 3 |
build/lib/longform/models.py | mattlinares/longform | 0 | 46536 | <filename>build/lib/longform/models.py
from django.db import models
from django.conf import settings
from modelcluster.fields import ParentalKey
from wagtail.core.models import Page, Orderable
from wagtail.core.fields import StreamField
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, StreamFieldPanel... | 2 | 2 |
tests/run_on_large_dataset.py | ur-whitelab/selfies | 367 | 46537 | """Script for testing selfies against large datasets.
"""
import argparse
import pathlib
import pandas as pd
from rdkit import Chem
from tqdm import tqdm
import selfies as sf
parser = argparse.ArgumentParser()
parser.add_argument("--data_path", type=str, default="version.smi.gz")
parser.add_argument("--col_name", t... | 2.453125 | 2 |
vision/module/get_module_depth.py | cjhr95/IARC-2020 | 0 | 46538 | <reponame>cjhr95/IARC-2020<gh_stars>0
"""
get_module_depth will return a float value for the relative depth of the module in the camera frame in meters,
given the depth frame (np array), and the approximate location of the center of the module in the frame (integer tuple)
The __main__ of this file acts as a driver for... | 3.125 | 3 |
AMAO/settings/celery_settings.py | arruda/amao | 2 | 46539 | <reponame>arruda/amao
#coding: utf-8
import djcelery
djcelery.setup_loader()
BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "admin"
BROKER_PASSWORD = "<PASSWORD>"
BROKER_VHOST = "/"
| 1.296875 | 1 |
chainer_chemistry/links/readout/set2set.py | pfnet/chainerchem | 184 | 46540 | from typing import List, Optional # NOQA
import chainer
from chainer import cuda
from chainer import functions
from chainer import links
import numpy # NOQA
class Set2Set(chainer.Chain):
r"""MPNN subsubmodule for readout part.
See: <NAME>+, \
Order Matters: Sequence to sequence for sets. November ... | 2.859375 | 3 |
matsuri_monitor/handlers/__init__.py | vancassa/matsuri-monitor | 15 | 46541 | <reponame>vancassa/matsuri-monitor
from matsuri_monitor.handlers.api import APIHandler
from matsuri_monitor.handlers.archives import ArchivesHandler
from matsuri_monitor.handlers.main import MainHandler
| 1.070313 | 1 |
kanbanflow_prj_selector/cli.py | igorbasko01/kanbanflow-prj-selector | 0 | 46542 | """Console script for kanbanflow_prj_selector."""
import sys
import click
from .kanbanflow_prj_selector import start
@click.command()
@click.option('-f', '--board-token-path', help='Input file with board tokens to fetch', required=True)
def main(board_token_path):
"""Console script for kanbanflow_prj_selector.""... | 2.140625 | 2 |
plugin.program.super.favourites/viewer.py | TheWardoctor/wardoctors-repo | 1 | 46543 | #
# Copyright (C) 2014-2015
# <NAME> (<EMAIL>)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is d... | 2.390625 | 2 |
datasets/cifar10.py | cheerss/COP | 47 | 46544 | <reponame>cheerss/COP<filename>datasets/cifar10.py
import os
import tensorflow as tf
label_bytes = 1 # 2 for CIFAR100
height = 32
width = 32
depth = 3
image_bytes = height * width * depth
record_bytes = label_bytes + image_bytes
num_examples_for_train = 50000
num_examples_for_test = 10000
num_classes = 10
def _parse_... | 2.90625 | 3 |
v1/schemas/auth.py | takotab/cloudrun-fastapi | 74 | 46545 | from pydantic import UUID4, BaseModel, EmailStr
class Token(BaseModel):
access_token: str
token_type: str
class TokenData(BaseModel):
email: EmailStr = None
id: UUID4 = None
| 2.375 | 2 |
setup.py | PyCav/PyCav-Module | 3 | 46546 | <gh_stars>1-10
import versioneer
from setuptools import setup, find_packages, Extension
from codecs import open
from os import path
have_cython = False
try:
from Cython.Distutils import build_ext
have_cython = True
except ImportError:
from distutils.command.build_ext import build_ext
mechanics = None
if ha... | 1.640625 | 2 |
arne_skill_pipeline/script/learn_trajectories.py | fzi-forschungszentrum-informatik/ArNe | 2 | 46547 | <gh_stars>1-10
#!/usr/bin/env python
################################################################################
# Copyright 2022 FZI Research Center for Information Technology
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 2.578125 | 3 |
app/api/__init__.py | ivelinahristova/webanalysis | 0 | 46548 | <gh_stars>0
"""
app.api
~~~~~~~~~~~~~~~~~~
This module contains views for project's API service.
"""
from app.api.views import api | 1.101563 | 1 |
Gym/settings/dir_gen.py | Alee08/MultiUAV-RL-RB | 4 | 46549 | import csv
import os
from os import mkdir
from os.path import isdir
from datetime import datetime
import ast
from configuration import Config
conf = Config()
traj_j = []
policy_per_plot = []
plot_policy = []
traj_j_ID = []
CSV_DIRECTORY_NAME = "Flights_trajectories"
BP_DIRECTORY_NAME = 'Best_policy/'
myfile = "./Bes... | 2.46875 | 2 |
populator/tests/test_migration_processing.py | gbif-norway/resolver-docker | 0 | 46550 | <reponame>gbif-norway/resolver-docker<gh_stars>0
from populator.management.commands import _migration_processing as migration_processing
from populator.management.commands.populate_resolver import create_duplicates_file
from populator.models import ResolvableObjectMigration
from django.db import connection, transaction... | 2.03125 | 2 |
mallet/AFNetworking/AFURLSessionManager.py | bartoszj/Mallet | 16 | 46551 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 <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 ... | 1.273438 | 1 |
src/namegen.py | Advik-B/Data-Generator | 1 | 46552 | <filename>src/namegen.py
import random
class Human_:
"""Base class for humans"""
def setrandomgender(self, allow_other=False, **kwargs):
if type(kwargs.get('custom_gender')) != dict:
self.base_genders = [{'Male': ['He', 'Him']}, {'Female': ['She', 'Her']}]
elif type(kwargs.get('cust... | 3.5 | 4 |
main.py | RandomReaper/cloudio-endpoint-python-example | 0 | 46553 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from client import Sample_Client
import time
import random
# Create client
client = Sample_Client('sample.cfg')
time.sleep(5)
# Simple exemple
while(True):
print('Sending updates')
client.publish('Sensor1', 'L1_Volts', random.uniform(207,253))
client.publish... | 2.5625 | 3 |
backend/apps/cmdb/types/foreignkey.py | codelieche/erp | 0 | 46554 | # -*- coding:utf-8 -*-
"""
外键关联相关的选项:
- model: 关联的资产Model
- field:关联的字段,这个字段必须是unique,默认可选择id
- on_delete: 当关联的外键删除的时候的操作:cascade | set_null | disable
- on_update: 当关联的外键修改的时候: cascade | disable
这些功能/约束,都是用代码逻辑来实现的,其实尽量不要使用外键:
少用的话,其实可以把约束放到业务代码中
"""
from cmdb.types.base import BaseType
# 注意别循环引用了
from cmdb.models i... | 2.4375 | 2 |
test/img.py | milligan22963/Camera | 0 | 46555 | <gh_stars>0
from PIL import Image
def main():
try:
image = Image.open("/home/daniel/Pictures/buddy.jpg");
except IOError:
print("Error")
pass
if __name__ == "__main__":
print("Starting main")
main()
| 2.703125 | 3 |
docs/a.py | jianminzhu/chinaese6 | 0 | 46556 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import time
import urllib2
# SELECT "bmember" as type, COUNT(*) AS bmember FROM bmember WHERE isDownPics=0
# UNION ALL SELECT "memberby " as type, COUNT(*) AS memberby FROM memberby
# UNION ALL SELECT "membercontact" as type, C... | 2.640625 | 3 |
ExperimentResults/experimentResultAnalysis.py | nick-terry/Splitting-GP | 1 | 46557 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 24 07:54:30 2020
@author: pnter
"""
import pandas as pd
import os
from os.path import isfile,join
import matplotlib.pyplot as plt
import numpy as np
folderPath = 'C:/Users/pnter/Documents/GitHub/GP-Regression-Research/ExperimentResults'
def loadFiles():
... | 2.390625 | 2 |
binding.gyp | dimshik100/Epoc.js | 799 | 46558 | <gh_stars>100-1000
{
"targets": [
{
"target_name": "index",
"sources": [ "epoc.cc"],
"include_dirs" : [
"<!(node -e \"require('nan')\")"
],
"conditions": [
['OS=="mac"', {
"cflags": [ "-m64" ],
"ldflags": [ "-m64" ],
"xcode_settings": {
... | 0.960938 | 1 |
tokens.py | manuel-io/minicloud | 1 | 46559 | import sys, psycopg2, psycopg2.extras
def generate(user_id, db):
try:
with db.cursor(cursor_factory = psycopg2.extras.DictCursor) as cursor:
cursor.execute("""
INSERT INTO minicloud_auths (user_id) VALUES (%s) RETURNING token
""", [int(user_id)])
data = curs... | 2.78125 | 3 |
gorden_crawler/spiders/item_lacoste.py | Enmming/gorden_cralwer | 2 | 46560 | <filename>gorden_crawler/spiders/item_lacoste.py
# -*- coding: utf-8 -*-
from scrapy.spiders import Spider
from scrapy.selector import Selector
from gorden_crawler.items import BaseItem, ImageItem, SkuItem, Color
from scrapy import Request
from scrapy_redis.spiders import RedisSpider
import re
import execjs
import js... | 2.28125 | 2 |
Server/app/schema/mutations/user/register.py | Team-SeeTo/SeeTo-Backend | 4 | 46561 |
import graphene
from app.models import User
class RegisterMutation(graphene.Mutation):
class Arguments(object):
email = graphene.String()
username = graphene.String()
password = graphene.String()
is_success = graphene.Boolean()
message = graphene.String()
@staticmethod
... | 2.828125 | 3 |
commit_analysis.py | Serfentum/xcms_finder | 0 | 46562 | from init_repo import init_repo
def find_commit(repo, local_repo, version, branch='master'):
"""
Find commit with specified version in the DESCRIPTION file in the xcms repo
This function checkout to specified version
:param repo: git.repo.base.Repo - repository object
:param local_repo: str - path... | 2.859375 | 3 |
test_app/api/views.py | iamswaroopp/django-scaffold-generator | 6 | 46563 | <gh_stars>1-10
from rest_framework import viewsets
from rest_framework.viewsets import ModelViewSet
from rest_framework.permissions import DjangoModelPermissions
from ..models import Blog
from .serializers import BlogSerializer
class BlogViewset(ModelViewSet):
permission_classes = [ DjangoModelPermissions ... | 2.0625 | 2 |
mineral/core/samplers/path_sampler.py | brandontrabucco/jetpack | 5 | 46564 | """Author: <NAME>, Copyright 2019"""
import numpy as np
import mineral as ml
from mineral.core.samplers.sampler import Sampler
class PathSampler(Sampler):
def __init__(
self,
env,
policies,
buffers,
time_skips=(1,),
**kwargs
):
Sampl... | 2.265625 | 2 |
usaspending_api/references/migrations/0055_auto_20170319_1841.py | toolness/usaspending-api | 1 | 46565 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-03-19 18:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('references', '0054_auto_20170308_2100'),
]
operations = [
migrations.Create... | 1.671875 | 2 |
multauth/mixins.py | andrenerd/django-multiform-authentication | 7 | 46566 | from importlib import import_module
from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import gettext_lazy as _
from django.utils.module_loading import import_string
from django.conf import settings
from django_otp import devices_for_user
from .services import Us... | 2.09375 | 2 |
bioinformatics_stronghold/subs.py | Wytamma/Rosalind | 0 | 46567 | <reponame>Wytamma/Rosalind
SAMPLE_DATASET = """GATATATGCATATACTT
ATAT
"""
SAMPLE_OUTPUT = """2 4 10"""
def kmer_generator(string, n):
"""returns a generator for kmers of length n"""
return (string[i : i + n] for i in range(0, len(string)))
def solution(dataset: list) -> str:
s, t = map(lambda x: x.strip... | 2.84375 | 3 |
skyline_apiserver/schemas/extension.py | openstack/skyline-apiserver | 0 | 46568 | <reponame>openstack/skyline-apiserver<gh_stars>0
# Copyright 2021 99cloud
#
# 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... | 1.578125 | 2 |
task-1/main.py | kushkamisha/applied-programming | 0 | 46569 | <gh_stars>0
import math
"""
За один прохід з послідовності довільних цілих чисел (додатні, від'ємні, нуль)
вибрати три числа, добуток яких є максимально можливим.
Технічні вимоги.
Вхід Текстовий файл, у першому рядку - кількість n цілих чисел
(2 < n < 108), у наступних n рядках - цілі числа.
Вих... | 3.5625 | 4 |
util.py | timsliu/nimble-notifier | 0 | 46570 | <gh_stars>0
# util.py
#
# utility functions common to multiple files
import json
import os
from pyzipcode import ZipCodeDatabase
import random
from geopy.geocoders import Nominatim
def address_to_coors(address):
'''converts an address string to lat lon coordiantes. Currently not
used due to being really slow... | 2.921875 | 3 |
SimCalorimetry/HcalZeroSuppressionProducers/python/NoHcalZeroSuppression_cff.py | ckamtsikis/cmssw | 852 | 46571 | <filename>SimCalorimetry/HcalZeroSuppressionProducers/python/NoHcalZeroSuppression_cff.py
# Fragment to switch off HCAL zero suppression as an option
# by cmsDriver customisation
# to generate Unsuppressed digis, one has to set the following parameter:
# process.simHcalDigis.useConfigZSvalues = 1
# to generate suppres... | 1.382813 | 1 |
tests/test_library.py | movermeyer/mopidy-oe1 | 9 | 46572 | from __future__ import unicode_literals
import unittest
from mock import Mock
from mopidy.models import Ref
from mopidy_oe1.library import OE1LibraryProvider, OE1LibraryUri, OE1UriType
class OE1LibraryUriTest(unittest.TestCase):
def test_parse_root_uri(self):
uri = 'oe1:directory'
result = OE1... | 2.4375 | 2 |
acdh_arche_pyutils/utils.py | acdh-oeaw/acdh-arche-pyutils | 0 | 46573 | <reponame>acdh-oeaw/acdh-arche-pyutils
"""Some utility functions module."""
def camel_to_snake(s):
""" converts CamelCase string to camel_case\
taken from https://stackoverflow.com/a/44969381
:param s: some string
:type s: str:
:return: a camel_case string
:rtype: str:
... | 3.21875 | 3 |
60-Publish/combine_packages_xml.py | marble/Toolchain_RenderDocumentation | 0 | 46574 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Integrate two files known as 'packages.xml'.
Usage:
python combine_packages_xml.py FPATH_1 FPATH_2 >result.xml
Description:
The script reads FPATH_1 and updates the data with FPATH_2.
Entries are sorted by 'version+language'. The file timestamp
is set... | 2.515625 | 3 |
py/testdir_single_jvm/test_failswith512chunk.py | gigliovale/h2o | 882 | 46575 | <reponame>gigliovale/h2o<gh_stars>100-1000
import unittest, time, sys
# not needed, but in case you move it down to subdir
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i
import h2o_browse as h2b
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_error... | 2.03125 | 2 |
modules/scripts/ceas_getMetaStats.py | baigal628/CHIPS | 10 | 46576 | <reponame>baigal628/CHIPS<filename>modules/scripts/ceas_getMetaStats.py
#!/usr/bin/env python
"""Script to collect the peak distribution stats
Outputs:
Run,Total,Promoter,Exon,Intron,Intergenic
"""
import os
import sys
from optparse import OptionParser
def main():
usage = "USAGE: %prog -f [FILE_1] -f [FILE_2] ..... | 2.484375 | 2 |
Pytorch/label_GT.py | jercas/RetinaTextBoxes- | 3 | 46577 | import os
import glob
from PIL import Image, ImageDraw
# ground truth directory
gt_text_dir = './DB/PLATE/gt' #"./DB/ICDAR2015/test/gt" #"./DB/ICDAR2015/train/gt"
# original images directory
image_dir = './DB/PLATE/*.jpg'#"./DB/ICDAR2015/test/*.jpg" #"./DB/ICDAR2015/train/*.jpg"
imgDirs = []
imgLists = glob.glob(imag... | 2.71875 | 3 |
checks.d/unbound.py | cclauss/datadog-checks | 0 | 46578 | <reponame>cclauss/datadog-checks
import subprocess
from checks import AgentCheck
class UnboundCheck(AgentCheck):
SERVICE_CHECK_NAME = 'unbound'
def get_cmd(self):
if self.init_config.get('sudo'):
cmd = 'sudo unbound-control stats'
else:
cmd = 'unbound-control stats'
... | 2.171875 | 2 |
running_modes/configurations/reinforcement_learning/reinforcement_learning_components.py | lilleswing/Reinvent-1 | 183 | 46579 | from dataclasses import dataclass
from reinvent_scoring.scoring.diversity_filters.reinvent_core.diversity_filter_parameters import \
DiversityFilterParameters
from reinvent_scoring.scoring.scoring_function_parameters import ScoringFunctionParameters
from running_modes.configurations.reinforcement_learning.incepti... | 2 | 2 |
torch/legacy/nn/SoftPlus.py | UmaTaru/run | 0 | 46580 | import torch
from .Module import Module
class SoftPlus(Module):
def __init__(self, beta=1):
super(SoftPlus, self).__init__()
self.beta = beta # Beta controls sharpness of transfer function
self.threshold = 20 # Avoid floating point issues with exp(x), x>20
def updateOutput(s... | 2.59375 | 3 |
setup.py | johannesdo/ipcbridge | 1 | 46581 | ### hack to avoid hardlinking through python setup.py sdist - doesn't work on vboxfs
import os
del os.link
###
from distutils.core import setup, Extension
#
# https://docs.python.org/3.3/extending/building.html#building
#
module1 = Extension('ipcbridge',
define_macros = [('MAJOR_VERSION', '0'),
... | 1.53125 | 2 |
backend/api/v1/watersheds/db_models.py | bcgov-c/wally | 0 | 46582 | import geoalchemy2
from sqlalchemy import String, Column, DateTime, ARRAY, TEXT, Integer, ForeignKey, Boolean, Numeric
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.dialects.postgresql import UUID, JSONB
from api.db.base_class import BaseTable, BaseAudit... | 2.3125 | 2 |
SPBS-SR/EvalSememePre_SPWE.py | clpl/BabelNet-Sememe-Prediction | 18 | 46583 | # coding:utf8
'''
利用synset的embedding,基于SPWE进行义原推荐
输入:所有synset(名词)的embedding,训练集synset及其义原,测试集synset
输出:测试集义原,正确率
'''
import sys
import os
import numpy as np
from numpy import linalg
import time
import random
outputMode = eval(sys.argv[1])
def ReadSysnetSememe(fileName):
'''
读取已经标注好义原的sysnet... | 2.71875 | 3 |
core/system.py | aweimeow/statuslook | 1 | 46584 | #! /usr/bin/python
# -*- coding: utf-8 -*-
import re
from subprocess import Popen, PIPE
def getIP(interface):
p = Popen('ifconfig %s' % interface, stdout=PIPE, stderr=PIPE, shell=True)
stdout = p.communicate()[0]
r = re.search('inet addr:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', stdout)
ip = r.group(1)
... | 2.859375 | 3 |
data/process_data.py | DanielDaCosta/RNN-Keras | 9 | 46585 | <reponame>DanielDaCosta/RNN-Keras
import pandas as pd
from sqlalchemy import create_engine
import sys
def load_data(messages_filepath, categories_filepath):
"""Function for importing data from CSV files
Params:
messages_filepath (string): path to messages.csv
categories_filepath (string): pat... | 3.359375 | 3 |
tests/test_visualization.py | adamshephard/tiatoolbox | 0 | 46586 | <gh_stars>0
"""Tests for visualization."""
import copy
import pathlib
import joblib
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pytest
from tiatoolbox.utils.visualization import (
overlay_prediction_contours,
overlay_prediction_mask,
overlay_probability_map,
plot_graph... | 1.851563 | 2 |
pycle/bicycle-scrapes/aamhwbike/denemeler.py | fusuyfusuy/School-Projects | 0 | 46587 | <filename>pycle/bicycle-scrapes/aamhwbike/denemeler.py
import os
from bs4 import BeautifulSoup
bicycle = {'Price':'------','Brand':'------','Model':'------','Frame': '------', 'Color': '------', 'Size': '------', 'Fork': '------', 'Headset': '------', 'Stem': '------', 'Handlebar': '------', 'Grips': '------', 'Rear D... | 2.15625 | 2 |
payu/subcommands/run_cmd.py | dkhutch/payu | 0 | 46588 | # coding: utf-8
# Standard Library
import os
import argparse
# Local
import payu
from payu import cli
from payu.experiment import Experiment
from payu.laboratory import Laboratory
import payu.subcommands.args as args
title = 'run'
parameters = {'description': 'Run the model experiment'}
arguments = [args.model, arg... | 2.1875 | 2 |
Aula14ex/ex02.py | danicon/MD2-Curso_Python | 1 | 46589 | n1 = float(input('Primeiro número: '))
n2 = float(input('Segundo número: '))
opcao = 0
while opcao != 5:
print()
print(''' [1]Somar
[2]Multiplicar
[3]Maior
[4]Novos números
[5]Sair do programa''')
print()
opcao = int(input('Escolha uma opção: '))
if opcao == 1:... | 3.875 | 4 |
validator903/datastore.py | kws/quality-lac-data-beta-validator | 0 | 46590 | <filename>validator903/datastore.py
import datetime
import logging
import os
from pathlib import Path
from typing import Dict, Any
import numpy as np
from copy import copy
import pandas as pd
import qlacref_authorities
from pandas import DataFrame
from qlacref_postcodes import Postcodes
logger = logging.getLogger(__n... | 2.5625 | 3 |
automation/models.py | leonolan2020/phoenix | 1 | 46591 | from app.persian import PersianCalendar
from django.db import models
from .enums import UnitNameEnum,ProductRequestStatusEnum,LetterStatusEnum,AgentRoleEnum
from app.enums import ColorEnum,IconsEnum,EmployeeEnum,DegreeLevelEnum
from django.shortcuts import reverse
from app.settings import ADMIN_URL
from django.utils.tr... | 1.789063 | 2 |
test/integration/samples_in/percent_numerics.py | krajkumard/flynt | 0 | 46592 | a, b, c, d, e = tuple(range(5))
print('%d %f %e %g %s' % (a,b,c,d,e)) | 3.09375 | 3 |
ok2_backend/KNSQueries/migrations/0002_auto_20210123_1519.py | moshe742/ok2-backend | 0 | 46593 | # Generated by Django 3.1.3 on 2021-01-23 15:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('KNSQueries', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='person',
name='is_current',
... | 1.65625 | 2 |
main.py | JiangNanMax/qp12306 | 2 | 46594 | from PyQt5.Qt import *
from Login_Pane import LoginPane
from Query_Pane import QueryPane
if __name__ == '__main__':
import sys
app = QApplication(sys.argv)
login_pane = LoginPane()
login_pane.show()
query_pane = QueryPane()
def success_login_slot(content):
print(content)
lo... | 2.359375 | 2 |
paper/figures/symmetric-widefield.py | talonchandler/dipsim | 0 | 46595 | from dipsim import multiframe, util
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.patches as patches
import os; import time; start = time.time(); print('Running...')
import matplotlib.gridspec as gridspec
# Main input parameters
col_labels = ['Geometry\n (NA = 0.6, $\\beta=80{}... | 2.21875 | 2 |
apps/common/behaviors/uploadable.py | yudame/prakti-api | 0 | 46596 | import json
import uuid
from jsonfield import JSONField
from django.db import models
class Uploadable(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
url = models.URLField(default="")
meta_data = JSONField(blank=True, null=True)
class Meta:
abstrac... | 2.34375 | 2 |
dash_oyku/models.py | efebuyuk/jd_intern_project | 1 | 46597 | <reponame>efebuyuk/jd_intern_project
from django.db import models
from django.db.models import IntegerField, Model, JSONField
class notebook(models.Model):
name = models.CharField(max_length=500)
cell_count = models.IntegerField(default=0)
code_cell_count = models.IntegerField(default=0)
... | 2.25 | 2 |
flowws_structure_pretraining/analysis/BondDenoisingVisualizer.py | klarh/flowws-structure-pretraining | 0 | 46598 | <filename>flowws_structure_pretraining/analysis/BondDenoisingVisualizer.py
import functools
import flowws
from flowws import Argument as Arg
import plato
from plato import draw
import numpy as np
from .internal import GeneratorVisualizer
from ..FileLoader import FileLoader
@flowws.add_stage_arguments
class BondDeno... | 2.40625 | 2 |
adv/ieyasu.py.means.py | betairylia/dl | 0 | 46599 | <filename>adv/ieyasu.py.means.py
import adv_test
from adv import *
from adv import ieyasu
from module.bleed import mBleed
import slot
def module():
return Ieyasu
class Ieyasu(ieyasu.Ieyasu):
def prerun(this):
this.s2buff = Selfbuff("s2",0.15, 15, 'crit')
this.s2buff.modifier.get = this.s2ifble... | 2.390625 | 2 |