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/language/semantic_analysis/type_builder.py | ArielTriana/battle-sim | 2 | 12769251 | <filename>src/language/semantic_analysis/type_builder.py
from .context import *
from typing import List
from ...utils.visitor import *
from ..parser.ast import *
class Type_Builder:
def __init__(self, context) -> None:
self.context = context
self.current_type : Type
@visitor(BsFile)
def... | 2.578125 | 3 |
mridc/collections/common/callbacks/callbacks.py | jerke123/mridc | 0 | 12769252 | # encoding: utf-8
__author__ = "<NAME>"
# Taken and adapted from: https://github.com/NVIDIA/NeMo/blob/main/nemo/collections/common/callbacks/callbacks.py
import time
from pytorch_lightning.callbacks.base import Callback
from pytorch_lightning.utilities import rank_zero_only
class LogEpochTimeCallback(Callback):
... | 2.5 | 2 |
src/middleware/processContactForm.py | jskrable/personal-site | 0 | 12769253 | <filename>src/middleware/processContactForm.py
#!/usr/bin/env python3
# coding: utf-8
"""
title: processContactForm.py
date: 02-18-2020
author: jskrable
description: lambda function to process contact form submissions
"""
import json
import uuid
import boto3
import datetime
def lambda_handler(event, context):
""... | 2.453125 | 2 |
FigureSimulation.py | grewelle/geneDriveSchistoReview | 0 | 12769254 | <gh_stars>0
import scipy
import numpy as np
from scipy.integrate import quad
from matplotlib import pyplot as plt
import seaborn as sns; sns.set(style="white", color_codes=True)
SMALL_SIZE = 36
MEDIUM_SIZE = 48
BIGGER_SIZE = 64
plt.rc('font', size=SMALL_SIZE) # controls default text sizes
plt.rc('... | 2.765625 | 3 |
Board/BitBoard.py | y701311/Othello | 2 | 12769255 | from Board.Board import Board
from Location.Location import Location
from Board.Disc import Disc
# BoardクラスのbitBoardとしての実装
class BitBoard(Board):
def __init__(self) -> None:
# 打っているプレイヤーの色
self.player = Disc.black
self.turn = 1
self.playerBoard = 0x0000000810000000
self.oppo... | 3.1875 | 3 |
zad2/zad2.py | Rogue05/SPD | 0 | 12769256 | <filename>zad2/zad2.py
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 16 12:33:07 2019
@author: Wojtek
"""
from Process import *
from copy import deepcopy
def insertions(elem,base_list):
for i in range(len(base_list)+1):
yield [*base_list[0:i],elem,*base_list[i:]]
def removals(elem,base_list):
... | 2.609375 | 3 |
lib/airflow/airflow/contrib/jobs/scheduler_client.py | aqua7regia/ai-flow | 0 | 12769257 | <gh_stars>0
# 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"); y... | 2.09375 | 2 |
investor_management/urls.py | BuildForSDG/Team-004-Backend | 2 | 12769258 | from django.urls import path
from rest_framework.routers import DefaultRouter
from investor_management import views
router = DefaultRouter()
app_name = 'investor_management'
urlpatterns = [
path('user/create/', views.CreateInvestorUserView.as_view(), name='investor_user_create'),
path('user/manage/<int:id>... | 1.8125 | 2 |
flaskApp.py | johnsliao/flask-bp | 0 | 12769259 | import os
import sqlite3
from flask import Flask, render_template
from contextlib import closing
app = Flask(__name__)
app.config.update(dict(
DATABASE=os.path.join(app.root_path, 'flaskApp.db'),
))
def connect_db():
return sqlite3.connect(app.config['DATABASE'])
def init_db():
with closing(connect_db())... | 2.5 | 2 |
blogapp/admin.py | melodyPereira05/ShopStop | 0 | 12769260 | <filename>blogapp/admin.py
from django.contrib import admin
# Register your models here.
from .models import BlogModel, CommentModel
admin.site.register(BlogModel)
admin.site.register(CommentModel)
| 1.515625 | 2 |
nn_xor_relu_act.py | Hanumanth004/NN_XOR_implementation | 0 | 12769261 | <filename>nn_xor_relu_act.py
import numpy as np
from scipy.special import expit
hidden_size=4
input_size=2
classes=1
X=np.array(([[0, 0],[0, 1],[1, 0],[1, 1]]))
Wh=np.random.randn(hidden_size,input_size)
bh=np.random.randn(hidden_size,1)
Wo=np.random.randn(1,hidden_size)
bo=np.random.randn(classes,1)
T=np.array(([[0]... | 2.546875 | 3 |
VisualizeApp/migrations/0001_initial.py | KnownAsNob/SOStimate | 0 | 12769262 | <gh_stars>0
# Generated by Django 3.0 on 2020-01-26 01:22
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Calls',
... | 2 | 2 |
recognizer/pddl/propositional_planner.py | RukNdf/MA-Landmark | 0 | 12769263 | #!/usr/bin/env python
# Four spaces as indentation [no tabs]
#
# propositional_planner.py
# ma-goal-recognition
#
# Created by <NAME> on 2020-03-12.
# Copyright 2020 <NAME>. All rights reserved.
#
from recognizer.pddl.pddl_parser import PDDL_Parser
from recognizer.pddl.pddl_planner import PDDL_Planner
# from reco... | 2.453125 | 2 |
pyxsim/utils.py | Joeybraspenning/pyxsim | 17 | 12769264 | <reponame>Joeybraspenning/pyxsim
from unyt import unyt_array, unyt_quantity
from astropy.units import Quantity
import logging
from more_itertools import always_iterable
import numpy as np
pyxsimLogger = logging.getLogger("pyxsim")
ufstring = "%(name)-3s : [%(levelname)-9s] %(asctime)s %(message)s"
cfstring = "%(name)... | 2.078125 | 2 |
utils/validation.py | Weenkus/on_power_efficient_virtual_network_function_placement_algorithm | 1 | 12769265 |
class Assert(object):
@staticmethod
def is_instance(instance, instances_class):
assert isinstance(instance, instances_class), '{0} should be an instance of class {1}'.format(
instance.__name__, instances_class.__name__
)
| 3.4375 | 3 |
pytorch_lightning/utilities/signature_utils.py | mathemusician/pytorch-lightning | 3,469 | 12769266 | # Copyright The PyTorch Lightning 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 i... | 2.53125 | 3 |
storage/pynetwork/DB/Physics/prime.py | opensourceplanet/ICS | 0 | 12769267 | #Prime Number Checker
#<NAME>
'''
This program asks for a number between 0 and 5000
If the number isn't in that range it asks for it again
When a proper number is entered it checks if it is prime
If the numbr is prime it prints the two factors
If the number is not prime it prints all the factors
Finally it asks if you... | 4.21875 | 4 |
Laelia/apps/meds/admin.py | arantesdv/LaeliaAppProject | 0 | 12769268 | from django.contrib import admin
from .models import ActiveCompound, CompoundSet, ComercialDrug, Prescription
@admin.register(ActiveCompound)
class ActiveCompoundAdmin(admin.ModelAdmin):
search_fields = ['_search_names']
@admin.register(CompoundSet)
class CompoundSetAdmin(admin.ModelAdmin):
search_fields = ['act... | 1.601563 | 2 |
gc_win2.py | danz2004/learning_python | 0 | 12769269 | #!/usr/bin/env python3
# Write a program that computes the GC fraction of a DNA sequence in a window
# Window size is 11 nt
# Output with 4 significant figures using whichever method you prefer
# Use no nested loops. Instead, count only the first window
# Then 'move' the window by adding 1 letter on one side
# And subt... | 4 | 4 |
mmda/utils/tools.py | allenai/mmda | 32 | 12769270 | from typing import List, Union, Dict, Any, Tuple
from mmda.types.span import Span
from mmda.types.box import Box
def merge_neighbor_spans(spans: List[Span], distance) -> List[Span]:
"""Merge neighboring spans in a list of un-overlapped spans:
when the gaps between neighboring spans is not larger than the
... | 3.140625 | 3 |
Day 18: Duet/Day 18: Duet.py | djvanhelmond/AdventofCode2017 | 0 | 12769271 | <reponame>djvanhelmond/AdventofCode2017
#!/usr/local/bin/python3
class Duet():
def __init__(self, instruction_list):
self.instruction_list = [ instruction.split() for instruction in instruction_list ]
self.program_counter = 0
self.registers = {}
self.played = None
self.nonZe... | 3.15625 | 3 |
Uebung3/Uebung3_Aufgabe8_2_3.py | B0mM3L6000/EiP | 1 | 12769272 | <reponame>B0mM3L6000/EiP
n = int(2367363789863971985761)
#überprüfen welche länge n = 2367363789863971985761 hat
#print(n)
i = 1
while n != 1: #solange n noch nicht gleich 1 ist
if n%2 == 0: #wenn n durch 2 ganz teilbar ist
n = n//2
#print(n)
else: #ansonsten
n = n*3+1
... | 3.234375 | 3 |
NN_adj_new_75.py | hlibe/FinTech-of-Networks | 0 | 12769273 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 30 09:52:31 2021
@author: HaoLI
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 8 11:48:41 2021
@author: HaoLI
"""
import torch, torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torc... | 2.140625 | 2 |
reo/migrations/0142_auto_20211206_2100.py | NREL/REopt_API | 7 | 12769274 | # Generated by Django 3.1.13 on 2021-12-06 21:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('reo', '0141_auto_20211202_2315'),
]
operations = [
migrations.RemoveField(
model_name='sitemodel',
name='preprocessed_BAU_l... | 1.375 | 1 |
examples/splitter.py | naturalis/imgpheno | 15 | 12769275 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import logging
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('.'))
import cv2
import numpy as np
import common
import imgpheno as ft
def main():
logging.basicConfig(level=logging.INFO, format='%(le... | 2.6875 | 3 |
setup.py | Einstein-Floripa/reply-card-corrector | 2 | 12769276 | from setuptools import setup, find_packages
setup(
name='reply_card_corrector',
version='0.1.0',
packages=find_packages(),
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
install_requires=["opencv-python", "numpy"],
)
| 1.109375 | 1 |
typesense-exporter.py | Alasano/typesense-exporter | 0 | 12769277 | <reponame>Alasano/typesense-exporter<gh_stars>0
import os
import json
import bottle
import requests
exporter_address = os.environ.get('TS_EXPORTER_LISTEN_ADDRESS', '0.0.0.0')
exporter_port = os.environ.get('TS_EXPORTER_LISTEN_PORT', 9000)
exporter_prefix = os.environ.get('TS_EXPORTER_METRICS_PREFIX', 'typesense')
typ... | 2.3125 | 2 |
models/appointments/appointment.py | lohmann99/odensefotografen | 0 | 12769278 | import uuid
from static.common.database import Database
class Appointment(object):
def __init__(self, owner_id, date, time, confirmed=False, _id=None):
self.owner_id = owner_id
self.date = date
self.time = time
self.confirmed = confirmed
self._id = uuid.uuid4().hex if _id i... | 2.625 | 3 |
regex_redirects/migrations/0005_auto_20210425_1321.py | benkonrath/django-regex-redirects | 7 | 12769279 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('regex_redirects', '0004_auto_20170512_1349'),
]
operations = [
migrations.AlterField(
model_name='redirect',
name='old_path',
... | 1.6875 | 2 |
gridaurora/filterload.py | scivision/gridaurora | 0 | 12769280 | <filename>gridaurora/filterload.py
#!/usr/bin/env python
from pathlib import Path
import logging
import numpy as np
from scipy.interpolate import interp1d
import h5py
import xarray
# consider atmosphere
try:
import lowtran
except ImportError as e:
logging.error(f"failure to load LOWTRAN, proceeding without atm... | 2.359375 | 2 |
spec_creation/autofill_eval_spec.py | hariv/e-mission-eval-public-data | 0 | 12769281 | import argparse
import logging
import json
import copy
import arrow
import requests
import osmapi
import re
import polyline as pl
import osrm as osrm
import shapely.geometry as geo
sensing_configs = json.load(open("sensing_regimes.all.specs.json"))
def validate_and_fill_datetime(current_spec):
ret_spec = copy.cop... | 2.109375 | 2 |
mysite/SocialApp/utils.py | asmao7/Cmput404W2021 | 3 | 12769282 | <filename>mysite/SocialApp/utils.py<gh_stars>1-10
"""
Contains useful helper functions
"""
import requests, json
from requests.auth import HTTPBasicAuth
from .models import Author, Post, Comment, PostCategory, InboxItem, Followers, ForeignServer
def AuthorToJSON(author):
"""
Converts an Author object into a JS... | 2.640625 | 3 |
miasmod_data_ui.py | DarkStarSword/miasmata-fixes | 10 | 12769283 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'miasmod_data.ui'
#
# Created: Tue Apr 29 18:40:05 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.1
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MiasmataData(object):
def se... | 1.6875 | 2 |
set_up_grasp_models/check_models/mass_balance_checks.py | martamatos/set_up_grasp_models | 0 | 12769284 | <gh_stars>0
def check_flux_balance(data_dict: dict) -> bool:
"""
When all fluxes are specified in the measRates sheet, check if all metabolites are mass balanced (well, the ones
that are marked as balanced in the mets sheet).
If everything is fine flag is 0, otherwise it is set to 1.
Args:
... | 2.9375 | 3 |
tests/test_features.py | ShayestehHS/jw_nx | 0 | 12769285 | import datetime
from datetime import timedelta
from tests.base import *
from jw_nx.tokens import AccessToken, RefreshToken
from jw_nx.settings import api_settings
class TestFeatures(BaseTest):
def test_invalid_algorithm(self):
""" Test setting invalid algorithm is raising error """
ac, re = self... | 2.59375 | 3 |
urlUpdated.py | GrissomE/urlUpdated | 0 | 12769286 | <gh_stars>0
import time, os, hashlib, json, re, requests
from bs4 import BeautifulSoup
from twilio.rest import Client
from dotenv import load_dotenv
def log(text):
print(f'{time.strftime("%Y %m %d - %H:%M:%S")}: {text}')
def error(text, exception):
log(f'{text} while {exception.with_traceback}')
def load_jso... | 2.375 | 2 |
module03/solution.py | GNKirov/kiwitcmsgnkirov | 1 | 12769287 | def sum_of_digits(number):
"""
Calculating sum of digits of number
"""
sum = 0
number = abs(number)
while number > 0:
sum += number % 10
number = number // 10
return sum
def to_digits(number):
"""
Calculating the digits of the number
"""
digits = []
whil... | 4.3125 | 4 |
ibmsecurity/isam/base/network/felb/attributes/log.py | ibm-enio/ibmsecurity | 2 | 12769288 | import logging
logger = logging.getLogger(__name__)
module_uri = "/isam/felb/configuration/logging"
requires_modules = None
requires_versions = None
def get(isamAppliance):
"""
Retrieves logging configuration attributes
"""
return isamAppliance.invoke_get("Retrieving logging configuration", module_u... | 2.421875 | 2 |
Assingments/module03/week04/monday/sulfaroa.inclass.py | tonysulfaro/MI-250 | 0 | 12769289 | <gh_stars>0
# stuff for something
| 1.085938 | 1 |
backend/apps/mapview/utils.py | match4healthcare/match4healthcare | 2 | 12769290 | <reponame>match4healthcare/match4healthcare<gh_stars>1-10
import json
from math import asin, cos, radians, sin, sqrt
from os.path import abspath, dirname, join
current_location = dirname(abspath(__file__))
with open(join(current_location, "files/plzs_merged.json")) as f:
plzs = json.loads(f.read())
def haversin... | 2.796875 | 3 |
pypy/iterator_generator_coroutine/first_of_all/3_generator_send_func.py | DowsonJones/test_test | 1 | 12769291 | <reponame>DowsonJones/test_test
def consumer():
r = ''
while True:
n = yield r # 返回的是r, 通过send函数接收的是n, 通过next和send都可以唤醒执行
# if not n:
# return
print('[CONSUMER] consuming %s' % n)
r = '200 OK'
def produce(c):
n = 0
while n < 5:
n = n + ... | 2.984375 | 3 |
tests/args/regex/test_args.py | benwhalley/pytest-bdd | 1 | 12769292 | """Step arguments tests."""
import functools
import re
from pytest_bdd import given, parsers, scenario, then, when
import pytest
from pytest_bdd import exceptions
scenario_when = functools.partial(scenario, "../when_arguments.feature")
scenario_args = functools.partial(scenario, "../args_steps.feature")
@scenari... | 2.859375 | 3 |
heuristics.py | MasterOdin/Connect4-AI | 0 | 12769293 | """
AI Heuristics for various evaluation methods
"""
from __future__ import print_function
import random
__author__ = "Matthew 'MasterOdin' Peveler"
__license__ = "The MIT License (MIT)"
class Heuristic(object):
"""
This is the heuristic interface
"""
@staticmethod
def get_best_column(board):
... | 3.515625 | 4 |
server/axeshome/util.py | kevinmcguinness/axes-home | 2 | 12769294 | #
# (c) Copyright 2015 <NAME>. All Rights Reserved.
#
"""
Various utilities.
"""
from flask.ext.restful import abort
from bson.objectid import ObjectId
from base64 import b64decode
from werkzeug.routing import BaseConverter
class AxesURIConverter(BaseConverter):
"""
Flask routing converter for AXES URIs of... | 2.46875 | 2 |
Libs/priors.py | VahidHeidari/StrBEAM | 0 | 12769295 |
NUM_ALLELES = 3
ALLELE_PRIOR = 1.0 / NUM_ALLELES
ALPHA = 1.5
MINUS_INFINITE = -1000000000
mBound = 6
jA = 10.0
jB = 0.5
pA = 0.1
pD = 0.1
pC = 1.0 - pD
pI = 0.1
if __name__ == '__main__':
print('This is a configuration file!')
| 1.679688 | 2 |
lesson_7/ultralight.py | windn19/Python_Developer | 1 | 12769296 | <gh_stars>1-10
from docx.shared import Cm # импорт из библиотеки класса для обработки изображений
from docxtpl import DocxTemplate, InlineImage
# импорт из библиотеки классов генерации doc документов из шаблонов и включения в них изображений
def get_context(result_sku_list):
"""
возвращает словарь значений, ... | 2.234375 | 2 |
stonesoup/updater/tests/test_ensemble.py | 0sm1um/Stone-Soup | 1 | 12769297 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""Test for updater.ensemble module"""
import numpy as np
import datetime
from stonesoup.models.measurement.linear import LinearGaussian
from stonesoup.types.detection import Detection
from stonesoup.types.hypothesis import SingleHypothesis
from stonesoup.types.prediction import ... | 2.265625 | 2 |
sdk/python/pulumi_oci/blockchain/get_blockchain_platform.py | EladGabay/pulumi-oci | 5 | 12769298 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 1.703125 | 2 |
etl/exporterWorker.py | MaastrichtUniversity/irods-open-access-repo | 2 | 12769299 | <gh_stars>1-10
#!/usr/bin/env python3
import os
import sys
import signal
import time
import logging
import pika
import json
from etl.dataverseManager.irods2Dataverse import DataverseExporter
from etl.irodsManager.irodsClient import irodsClient
log_level = os.environ['LOG_LEVEL']
logging.basicConfig(level=logging.get... | 2.25 | 2 |
atlassian/__init__.py | approximatenumber/atlassian-python-api | 0 | 12769300 | <reponame>approximatenumber/atlassian-python-api<gh_stars>0
from .confluence import Confluence
from .jira import Jira
from .bitbucket import Bitbucket
from .bitbucket import Bitbucket as Stash
from .portfolio import Portfolio
from .bamboo import Bamboo
from .crowd import Crowd
from .service_desk import ServiceDesk
__a... | 1.265625 | 1 |
tests/test_pyfuncs.py | aspuru-guzik-group/funsies | 28 | 12769301 | """Test of Funsies python functions capabilities."""
# std
from io import BytesIO
from typing import Dict
# funsies
from funsies import _pyfunc as p
from funsies._constants import Encoding
def capitalize(inputs: Dict[str, bytes]) -> Dict[str, bytes]:
"""Capitalize artifacts."""
out = {}
for key, val in i... | 3.09375 | 3 |
super function.py | blulady/python | 0 | 12769302 | <gh_stars>0
class A:
def feature1(self):
print("Feature 1 working")
def feature2(self):
print("Feature 2 working")
a1 = A()
a1.feature1()
class B(A):
def feature3(self):
print("feature 3 working")
def feature4(self):
print("feature 4 working")
b1 = B()
b1.feature2()... | 3 | 3 |
_multiselect_combobox_v2.py | iLLiCiTiT/PyQtMultiselectionCombobox | 0 | 12769303 | <filename>_multiselect_combobox_v2.py<gh_stars>0
import sys
from Qt import QtWidgets, QtCore, QtGui
class ViewFilter(QtCore.QSortFilterProxyModel):
def filterAcceptsRow(self, source_row, parent_index):
index = parent_index.child(source_row, 0)
checkstate = index.data(QtCore.Qt.CheckStateRole)
... | 2.515625 | 3 |
archive/Changesets/mbf-76446/Source/Tools/Python/BioIronPython/Web.py | jdm7dv/Microsoft-Biology-Foundation | 0 | 12769304 | <reponame>jdm7dv/Microsoft-Biology-Foundation
# Copyright Microsoft Corporation. All rights reserved.
import Util
Util.add_biodotnet_reference("Bio")
Util.add_biodotnet_reference("Bio.WebServiceHandlers")
from Bio.Web import *
from Bio.Web.Blast import *
from System.IO import *
_service = NCBIBlastHandler()
_config_p... | 1.835938 | 2 |
python-package/lets_plot/__init__.py | OLarionova-HORIS/lets-plot | 0 | 12769305 | <filename>python-package/lets_plot/__init__.py<gh_stars>0
#
# Copyright (c) 2019. JetBrains s.r.o.
# Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#
from pkgutil import extend_path
from typing import Dict
# To handle the situation when 'datalore' package is shared my mod... | 2.109375 | 2 |
HMongo/__init__.py | dominon12/HMongo | 1 | 12769306 | <filename>HMongo/__init__.py
from HMongo.MongoDB import MongoDB
| 1.226563 | 1 |
catalogs/views.py | paulsuh/mwa2 | 155 | 12769307 | <filename>catalogs/views.py
"""
catalogs//views.py
"""
from django.http import HttpResponse
from catalogs.models import Catalog
import json
import logging
LOGGER = logging.getLogger('munkiwebadmin')
def catalog_view(request):
'''Returns list of catalog names in JSON format'''
catalog_list = Catalog.list()
... | 2.71875 | 3 |
hypatia/physics.py | defcon201/hypatia-engine | 251 | 12769308 | <filename>hypatia/physics.py<gh_stars>100-1000
"""Physical attributes of things.
Right now, not much differs it from the constants
module, but there will surely be much more to do
with physics as time progresses.
See Also:
:mod:`constants`
"""
import pygame
from hypatia import constants
class Velocity(object... | 3.21875 | 3 |
PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py | MerdanBay/PythonRobotics | 1 | 12769309 | <gh_stars>1-10
"""
Path planning Sample Code with Closed loop RRT for car like robot.
author: AtsushiSakai(@Atsushi_twi)
"""
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import pure_pursuit
import unicycle_model
sys.path.appen... | 2.859375 | 3 |
argument-similarity/inference_no_topic_info.py | avouacr/acl2019-BERT-argument-classification-and-clustering | 0 | 12769310 | """Recompute BERT predictions on UKP dev/test without topic information."""
import os
import csv
import itertools
from tqdm import tqdm
from pytorch_pretrained_bert.tokenization import BertTokenizer
import torch
from torch.utils.data import TensorDataset, DataLoader, SequentialSampler
from train import InputExample, c... | 2.53125 | 3 |
venv/lib/python3.6/site-packages/ansible_collections/ansible/windows/tests/unit/plugins/filter/test_quote.py | usegalaxy-no/usegalaxy | 1 | 12769311 | # Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
import re
from ansible.errors import AnsibleFilterError
from an... | 2.015625 | 2 |
model.py | cvvsu/maskNPF | 0 | 12769312 | import os, glob
import numpy as np
import pandas as pd
from multiprocessing import Pool
from PIL import Image
from tqdm import tqdm
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import tkinter as tk
import warnings
warnings.filterwarnings("ignore")
... | 2.171875 | 2 |
mom/model.py | Sebastiencreoff/mongo_tool | 0 | 12769313 | #! /usr/bin/env python
import functools
import uuid
from . import session
from . import utils
class Model(object):
session = session.Session()
def __init__(self, data=None):
self._id = str(uuid.uuid1())
self.in_progress = False
self.read_only = False
self.update = False
... | 2.3125 | 2 |
python/cumulus/cumulus/snodas/core/config.py | USACE/cumulus-geolambda | 2 | 12769314 | # Application Install Directory (Relative to Inside Container)
SNODAS_APP = '/app/cumulus/snodas/core'
# Archive of UNMASKED files downloaded from NSIDC
SNODAS_RAW_UNMASKED = '/app/data/snodas/raw_unmasked'
# Archive of MASKED files downloaded from NSIDC
SNODAS_RAW_MASKED = '/app/data/snodas/raw_masked'
| 0.964844 | 1 |
blog/urls.py | flaab/pz-django-blog | 5 | 12769315 | <reponame>flaab/pz-django-blog
from django.conf.urls import url
from django.urls import path
from .feeds import LatestPostFeed
from . import views
# App name
app_name = 'blog'
# Url Patterns
urlpatterns = [
# Default lists all posts
url('^$', views.post_list, name='post_list'),
# List post by catego... | 2.140625 | 2 |
nk_ape/__init__.py | NewKnowledge/ape | 0 | 12769316 | <filename>nk_ape/__init__.py
import sys
import logging
from .ape import Ape
from .config import ONTOLOGY_PATH, EMBEDDING_PATH, LOG_LEVEL
logging.basicConfig(
level=LOG_LEVEL,
stream=sys.stdout,
)
| 1.796875 | 2 |
WRF_snapshots.py | NCAR/HWT_mode | 1 | 12769317 | """
Copied from WRF_SPC.py Sep 20, 2019.
Given a model initialization time and a valid time, plot crefuh around hagelslag objects.
"""
import argparse
import datetime
import pdb
import os
import sys
import pandas as pd
import numpy as np
import fieldinfo # levels and color tables - Adapted from /glade/u/home/wrfrt/... | 2.109375 | 2 |
bika/lims/exportimport/instruments/sysmex/xs/i500.py | hocinebendou/bika.gsoc | 0 | 12769318 | <reponame>hocinebendou/bika.gsoc<filename>bika/lims/exportimport/instruments/sysmex/xs/i500.py<gh_stars>0
""" Sysmex XS 500i
"""
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from . import SysmexXSImporter, SysmexXSCSVParser
import json
import traceback
title = "Sysmex XS - 500i"
def get... | 2.359375 | 2 |
BNB_Search/Board.py | Nurl4n/Artificial-Intelligence | 0 | 12769319 | <filename>BNB_Search/Board.py
import random
import copy
from copy import deepcopy
MAX_PRINT = 2
CUR_PRINT = 0
MAX_COLUMN = 4
MAX_ROW = 4
solution_length_from_board = 0
goal = [["1", "2", "3","4"],
["2", "3", "4","5"],
["3", "4", "5","5"],
["4", "5", "5","_"]]
# Rather than no... | 3.9375 | 4 |
src/tokenization/vocab.py | mahsaghn/BBCNews | 0 | 12769320 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Counter
import numpy as np
from itertools import chain
import json
import torch
from typing import List
import sentencepiece as spm
import os
def pad_sents(sents, pad_token):
sents_padded = []
maxlen = max([len(sent) for sent... | 2.421875 | 2 |
slimevolleygym/__init__.py | mgoulao/2v2-Slime-Volleyball | 2 | 12769321 | import slimevolleygym.game_settings
import slimevolleygym.slimevolley
from slimevolleygym.slimevolley import *
| 1.15625 | 1 |
utils/optimizer.py | wufanyou/Traffic4Cast-2020-TLab | 3 | 12769322 | from apex.optimizers import FusedLAMB, FusedAdam
from torch.optim.lr_scheduler import LambdaLR
from torch.optim import AdamW, Adam, SGD
import math
# https://huggingface.co/transformers/_modules/transformers/optimization.html#get_linear_schedule_with_warmup
def get_linear_schedule_with_warmup(
optimizer, num_warmu... | 2.90625 | 3 |
3rdparty/packages/all.py | cspanier/shift | 2 | 12769323 | #!/usr/bin/env python3
import sys
from build import Builder
package_name = Builder.package_name_from_filename(__file__)
dependencies = ('zlib-1.2.11',
'bzip2-1.0.8',
'jpeg-9c',
'zstd-be3bd70',
'tiff-4.0.10',
'icu4c-65_1',
... | 1.960938 | 2 |
main/mad_libs.py | TechnicallyMay/mad_libs_generator | 0 | 12769324 | <filename>main/mad_libs.py
import find_pos
from random import choice
from collections import defaultdict
class MadLibs():
def __init__(self, file_name):
self.file_name = "../data/" + file_name + ".txt"
self.text = self.get_text()
tagged_text = find_pos.tag_pos(self.text)
self.pos ... | 3.203125 | 3 |
tools/spaceSwitcher/python/spaceswitcher/ui.py | koborit/SpaceSwitcherSample | 0 | 12769325 | """
MIT License
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, distri... | 1.578125 | 2 |
test/check-gradient.sikuli/check-gradient.py | jsmaniac/travis-os | 0 | 12769326 | <filename>test/check-gradient.sikuli/check-gradient.py
wait("1529963334209.png", 10)
| 0.789063 | 1 |
pypacker/interceptor.py | dschoonwinkel/pypacker | 0 | 12769327 | <reponame>dschoonwinkel/pypacker<filename>pypacker/interceptor.py<gh_stars>0
"""
Packet interceptor using NFQueue
Requirements:
- CPython
- NFQUEUE target support in Kernel
- iptables
"""
import ctypes
from ctypes import util as utils
import socket
from socket import ntohl
import os
import threading
import logging
lo... | 2.328125 | 2 |
antidot/connector/generic/decorators.py | antidot/html-connector | 3 | 12769328 | <filename>antidot/connector/generic/decorators.py
import logging
from typing import List, Union
from colorama import Fore, init
from fluidtopics.connector import Client, LoginAuthentication, RemoteClient
from antidot.connector.generic.external_source_id_does_not_exists_error import ExternalSourceIdDoesNotExistsError
... | 2.234375 | 2 |
python/sys_context.py | robotlightsyou/test | 2 | 12769329 | <gh_stars>1-10
import sys
lines = 0
try:
with sys.stdout as output:
with sys.stdin as input:
for i in input:
output.write(i)
lines += 1
finally:
print('!!!!', lines, file=sys.stderr)
| 2.828125 | 3 |
ciri/modules/autotranslate.py | AmarnathCJD/Cirilla-Userbot | 0 | 12769330 | from google_translate_py import AsyncTranslator
from ciri import HelpStr
from ciri.utils import ciri_cmd, eor
@ciri_cmd(pattern="at(?: |$)(.*)")
async def _at(e):
payload = e.text.split(maxsplit=3)
if len(payload) == 3:
text = payload[2]
lang = payload[1]
else:
text = payload[1]
... | 2.90625 | 3 |
core/serializers.py | utkarshagarwal1312/potato-url | 0 | 12769331 | from rest_framework import serializers
from rest_framework.serializers import Serializer, ModelSerializer
from core.models import KeyUrlMap
class RedirectionSerializer(Serializer):
pass
class CreateMappingSerializer(ModelSerializer):
potato_url = serializers.SerializerMethodField(read_only=True)
class... | 2.375 | 2 |
gui_utils/threading.py | Arseha/peakonly | 65 | 12769332 | <reponame>Arseha/peakonly
from PyQt5 import QtCore
class WorkerSignals(QtCore.QObject):
"""
Defines the signals available from a running worker thread.
Attributes
----------
finished : QtCore.pyqtSignal
No data
error : QtCore.pyqtSignal
`tuple` (exctype, value, traceback.forma... | 2.546875 | 3 |
semantic-segmentation/lib/mnist_models.py | bcrafton/icsrl-deep-learning | 1 | 12769333 | <reponame>bcrafton/icsrl-deep-learning
import tensorflow as tf
import keras
import numpy as np
from lib.Model import Model
from lib.Layer import Layer
from lib.ConvToFullyConnected import ConvToFullyConnected
from lib.FullyConnected import FullyConnected
from lib.Convolution import Convolution
from lib.MaxPool impo... | 2.296875 | 2 |
Integrations/QRadar/QRadar_test.py | TBE-Comp/content | 7 | 12769334 | <filename>Integrations/QRadar/QRadar_test.py<gh_stars>1-10
import pytest
import demistomock as demisto
@pytest.fixture(autouse=True)
def init_tests(mocker):
mocker.patch.object(demisto, 'params', return_value={'server': 'www.qradar.com', 'token': '<PASSWORD>', 'proxy': True})
def test_enrich_offense_res_with_so... | 2.234375 | 2 |
ros2service/ros2service/verb/find.py | ruffsl/ros2cli | 0 | 12769335 | # Copyright 2019 Canonical Ltd.
#
# 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 writin... | 2.40625 | 2 |
pitool/web.py | calston/pitool | 0 | 12769336 | <reponame>calston/pitool<gh_stars>0
import json
import inspect
from twisted.web.template import renderer, XMLFile
from twisted.python.filepath import FilePath
from twisted.web.static import File
from twisted.web.template import tags
from .web_base import BaseResource, ContentElement, JSONResource
from . import pidat... | 1.96875 | 2 |
code/log_writer.py | WCU-EDGE/spark-dashboard | 0 | 12769337 | #This runs on each webserver and funnels the /var/log/auth contents to Kafka broker under topic XYZ
# This is a Kafka producer
from kafka import KafkaProducer
import time
import json
producer = KafkaProducer(bootstrap_servers='broker:9092',value_serializer=lambda v:json.dumps(v).encode('ascii'))
logfile = open('/var/... | 2.296875 | 2 |
Experiments/cross_entropy_demo.py | Golden-Slumber/AirFL-2nd | 1 | 12769338 | import random
import matplotlib
import numpy
from matplotlib import pyplot as plt
from matplotlib.ticker import PercentFormatter
from Resources.data_loader import load_data
from Utils.CrossEntropy import CrossEntropySolver
from Algorithms.CrossEntropy.Solver.ACCADE_cross_entropy_solver import ACCADECrossEntropySolve... | 2.265625 | 2 |
editor/lib/juma/core/dispatch/signals.py | RazielSun/juma-editor | 7 | 12769339 | # -*- coding: utf-8 -*-
__author__ = '<NAME>'
import threading
#import logging
#logger = logging.getLogger(__name__)
import idle_queue
from weak_ref import weak_ref
class Signal:
def __init__(self, name):
self.name = name
self.callbacks = []
self.lock = threading.Lock()
def __call__... | 2.3125 | 2 |
tests/test_api.py | inspired-co/eaas_client | 0 | 12769340 | # %%
import os
import unittest
from pathlib import Path
import jsonlines
from eaas import Client, Config
curr_dir = Path(__file__).parent
def read_jsonlines_to_list(file_name):
lines = []
with jsonlines.open(file_name, "r") as reader:
for obj in reader:
lines.append(obj)
return line... | 2.609375 | 3 |
seahub/avatar/management/commands/rebuild_avatars.py | odontomachus/seahub | 0 | 12769341 | # Copyright (c) 2012-2016 Seafile Ltd.
from django.core.management.base import BaseCommand
from seahub.avatar.models import Avatar
from seahub.avatar.settings import AUTO_GENERATE_AVATAR_SIZES
class Command(BaseCommand):
help = "Regenerates avatar thumbnails for the sizes specified in " + \
"settings.AUTO... | 2.40625 | 2 |
utils/test.py | JiatLn/yhshow-be | 0 | 12769342 | <gh_stars>0
import datetime
from load_yuhun_json import load_json_file
import algo
yuhun_list = load_json_file('yuhun.json')[1:]
l2_prop_limit = ['攻击加成']
l4_prop_limit = ['攻击加成']
l6_prop_limit = ['暴击', '暴击伤害']
optimize = '输出伤害'
limit_props = {'速度': {'min': 156, 'max': 158}, '暴击': {'min': 1, 'max': float('inf')}}
limi... | 2.21875 | 2 |
exportdoc.py | mbebenita/wast | 0 | 12769343 | #!/usr/bin/env python
# Copyright 2016 WebAssembly Community Group participants
#
# 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 ... | 2.265625 | 2 |
image_classif/app_image_classif_evaluate.py | icalciu/apps | 0 | 12769344 | import os
import sys
import random
import subprocess
import time
import turicreate as tc
#### Evaluate the model
# First create test and train data: app_image_classif_create.py
# And train the model: app_image_classif_model.py
######################
tracker='sudo /home/icalciu/ccfpga/peaberry/src/pbsim-ptrace/tracke... | 2.28125 | 2 |
k0001sumo.py | MartijnHarmenzon/openTLC | 10 | 12769345 | <reponame>MartijnHarmenzon/openTLC
# import libraries SUMO/TraCI
from __future__ import absolute_import
from __future__ import print_function
import traci
# import libraries openTLC
from k0001func import initialise
from k0001app import open_tlc
from k0001sumofunc import set_sumo_inputs, set_state
# import libraries o... | 2.03125 | 2 |
peek/api/authentication.py | and3rson/notez | 1 | 12769346 | <reponame>and3rson/notez<gh_stars>1-10
from rest_framework.authentication import SessionAuthentication
class CSRFExemptSessionAuthentication(SessionAuthentication):
def enforce_csrf(self, request): # pragma: no cover
return # To not perform the CSRF check previously happening
| 1.75 | 2 |
Examples/example25.py | ZibraMax/FEM | 10 | 12769347 | from FEM.Mesh.Geometry import Geometry
from FEM.Mesh.Delaunay import Delaunay
from FEM.PlaneStrain import PlaneStrain
from FEM.Utils.polygonal import roundCorner, giveCoordsCircle
import matplotlib.pyplot as plt
import numpy as np
E = 30*10**(5)
v = 0.25
b = 10
h = 20
he = h/4
ancho_en_h10_in = 18
ancho_en_h20_in = 1... | 2.546875 | 3 |
neuroir/inputters/multitask/vector.py | niazangels/context_attentive_ir | 77 | 12769348 | <reponame>niazangels/context_attentive_ir
# Adapted from https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py
import torch
import random
import copy
def vectorize(session, model, shuffle=False):
"""Torchify a single example."""
src_dict = model.src_dict
tgt_dict = model.tgt_dict
... | 2.515625 | 3 |
hs_web_server/dev_settings.py | kjb4494/hs-web-server | 0 | 12769349 | <gh_stars>0
"""
Django settings for hs_web_server project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/... | 1.367188 | 1 |
trigger/acl/tools.py | jccardonar/trigger | 380 | 12769350 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
Various tools for use in scripts or other modules. Heavy lifting from tools
that have matured over time have been moved into this module.
"""
__author__ = '<NAME>, <NAME>'
__maintainer__ = '<NAME>'
__email__ = '<EMAIL>'
__copyright__ = 'Copyright 2010-2011, AOL Inc.'
f... | 2.15625 | 2 |