max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
library/math_tool_box.py | brianchiang-tw/Python | 0 | 6630251 | import functools
import random
import math
class StatMaker:
container = []
size = 0
def __init__(self, new_list):
self.container = new_list
self.size = len(self.container)
# Get the minimum value of a series
def get_min(self):
min_value = functools.reduce( lambda smallest,... | import functools
import random
import math
class StatMaker:
container = []
size = 0
def __init__(self, new_list):
self.container = new_list
self.size = len(self.container)
# Get the minimum value of a series
def get_min(self):
min_value = functools.reduce( lambda smallest,... | en | 0.482989 | # Get the minimum value of a series # Get the maximum value of a series # Get the summation of a series # Get the average of a series # Get the standard deviation of a series # Recall: # var = { ( sigma[ (Xi - avg )^2 ] ) / (N-1) } # = { ( sigma[ Xi^2 ] - N * avg^2 ) / (N-1) } # std = sqrt(var) ### Tutorial: # l... | 3.6024 | 4 |
robopose/third_party/craves/heatmap_utils.py | lesteve/robopose | 43 | 6630252 | <filename>robopose/third_party/craves/heatmap_utils.py
import torch
import numpy as np
def heatmap_from_keypoints(bbox, pts2d):
scale_factor = 60.0
out_res = 64
nparts = 17
sigma = 1
label_type = 'Gaussian'
bbox = bbox.cpu().numpy()
pts2d = pts2d.cpu().numpy()
x0, y0, x1, y1 = bbox
... | <filename>robopose/third_party/craves/heatmap_utils.py
import torch
import numpy as np
def heatmap_from_keypoints(bbox, pts2d):
scale_factor = 60.0
out_res = 64
nparts = 17
sigma = 1
label_type = 'Gaussian'
bbox = bbox.cpu().numpy()
pts2d = pts2d.cpu().numpy()
x0, y0, x1, y1 = bbox
... | en | 0.741739 | # if tpts[i, 2] > 0: # This is evil!! # Draw a 2D gaussian # Adopted from https://github.com/anewell/pose-hg-train/blob/master/src/pypose/draw.py # Check that any part of the gaussian is in-bounds # If not, just return the image as is # Generate gaussian # The gaussian is not normalized, we want the center value to equ... | 2.328275 | 2 |
miwell-flask-app/tests/functional_tests/test_pages/test_main_pages/test_about_page.py | joshuahigginson1/DevOps-Assessment-1 | 1 | 6630253 | # Contains the code to test our about page.
# Imports --------------------------------------------------------------------------------
from tests.functional_test_framework import LiveServerTestCase
# Tests ----------------------------------------------------------------------------------
class TestAboutPage(LiveSe... | # Contains the code to test our about page.
# Imports --------------------------------------------------------------------------------
from tests.functional_test_framework import LiveServerTestCase
# Tests ----------------------------------------------------------------------------------
class TestAboutPage(LiveSe... | en | 0.253894 | # Contains the code to test our about page. # Imports -------------------------------------------------------------------------------- # Tests ---------------------------------------------------------------------------------- | 1.526103 | 2 |
tensorflow-mnist-code/admm_pruning.py | KaiqiZhang/admm-pruning | 90 | 6630254 | <gh_stars>10-100
# Copyright 2015 The TensorFlow 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
#
# U... | # Copyright 2015 The TensorFlow 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... | en | 0.747761 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 2.251371 | 2 |
examples/optionsdata.py | victorjourne/ezibpy | 296 | 6630255 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# ezIBpy: a Pythonic Client for Interactive Brokers API
# https://github.com/ranaroussi/ezibpy
#
# Copyright 2015 <NAME>
#
# Licensed under the GNU Lesser General Public License, v3.0 (the "License");
# you may not use this file except in compliance with the License.
# Yo... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# ezIBpy: a Pythonic Client for Interactive Brokers API
# https://github.com/ranaroussi/ezibpy
#
# Copyright 2015 <NAME>
#
# Licensed under the GNU Lesser General Public License, v3.0 (the "License");
# you may not use this file except in compliance with the License.
# Yo... | en | 0.792779 | #!/usr/bin/env python # -*- coding: UTF-8 -*- # # ezIBpy: a Pythonic Client for Interactive Brokers API # https://github.com/ranaroussi/ezibpy # # Copyright 2015 <NAME> # # Licensed under the GNU Lesser General Public License, v3.0 (the "License"); # you may not use this file except in compliance with the License. # Yo... | 2.354981 | 2 |
src/vsc/rand_obj.py | fvutils/pyvsc | 54 | 6630256 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | en | 0.843287 | # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u... | 1.452931 | 1 |
tests/pyre.pkg/filesystem/virtual_info.py | avalentino/pyre | 25 | 6630257 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# <NAME>. aïvázis
# orthologue
# (c) 1998-2021 all rights reserved
#
"""
Verify that the metadata associated with node are maintained properly
"""
def test():
# support
import pyre.primitives
# my package
import pyre.filesystem
# build a virtual ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# <NAME>. aïvázis
# orthologue
# (c) 1998-2021 all rights reserved
#
"""
Verify that the metadata associated with node are maintained properly
"""
def test():
# support
import pyre.primitives
# my package
import pyre.filesystem
# build a virtual ... | en | 0.849946 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # <NAME>. aïvázis # orthologue # (c) 1998-2021 all rights reserved # Verify that the metadata associated with node are maintained properly # support # my package # build a virtual filesystem # and a couple of nodes # check their uris # all done # main # skip pyre initial... | 2.157557 | 2 |
challenges/week_1/checker.py | Eric-Njoroge/python | 6 | 6630258 | import bus_fare_challenge as solution
import datetime
import unittest
class TestBusFareChallenge(unittest.TestCase):
def setUp(self) -> None:
self.date = datetime.datetime.now().date()
self.day = self.date.strftime("%a")
self.charts = {
"Mon": 100,
"Tue": 100,
... | import bus_fare_challenge as solution
import datetime
import unittest
class TestBusFareChallenge(unittest.TestCase):
def setUp(self) -> None:
self.date = datetime.datetime.now().date()
self.day = self.date.strftime("%a")
self.charts = {
"Mon": 100,
"Tue": 100,
... | en | 0.960739 | Tests whether the date returned by the program is correct. Tests whether the day returned by the program is correct. Tests whether the fare returned by the program is correct. | 3.77603 | 4 |
kaori/__init__.py | austinpray/kaori | 3 | 6630259 | from pathlib import Path
from .support.config import get_config
_test_config_path = Path(__file__).parent.joinpath('../config/kaori_test.py').absolute()
test_config = get_config(str(_test_config_path))
__all__ = ['test_config']
| from pathlib import Path
from .support.config import get_config
_test_config_path = Path(__file__).parent.joinpath('../config/kaori_test.py').absolute()
test_config = get_config(str(_test_config_path))
__all__ = ['test_config']
| none | 1 | 1.797832 | 2 | |
ch10/errorExample.py | rfreiberger/Automate-the-Boring-Stuff | 0 | 6630260 | <filename>ch10/errorExample.py<gh_stars>0
def spam():
bacon()
def bacon():
raise Exception('This is the error message.')
spam() | <filename>ch10/errorExample.py<gh_stars>0
def spam():
bacon()
def bacon():
raise Exception('This is the error message.')
spam() | none | 1 | 1.895998 | 2 | |
exam_practice/encapsulation.py | IroniX2/python-exercises | 0 | 6630261 | # Bad way
class Testing:
def __init__(self, x, y):
self.__set_x(x)
self.__set_y(y)
# Getters and Setters have to be private or else we have two ways -
# of doing something (not pythonic)
def __get_x(self):
return self.__x
def __set_x(self, x):
if x < 0:
... | # Bad way
class Testing:
def __init__(self, x, y):
self.__set_x(x)
self.__set_y(y)
# Getters and Setters have to be private or else we have two ways -
# of doing something (not pythonic)
def __get_x(self):
return self.__x
def __set_x(self, x):
if x < 0:
... | en | 0.836432 | # Bad way # Getters and Setters have to be private or else we have two ways - # of doing something (not pythonic) # Fix for bad setup to be able to call var.x - # instead of var.get_x() # Proper Properties way | 3.798641 | 4 |
bop_toolkit_lib/visibility.py | gist-ailab/bop_toolkit | 201 | 6630262 | <reponame>gist-ailab/bop_toolkit<gh_stars>100-1000
# Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
"""Estimation of the visible object surface from depth images."""
import numpy as np
def _estimate_visib_mask(d_test, d_model, delta, visib_mode='bop19'):
"""Estimate... | # Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
"""Estimation of the visible object surface from depth images."""
import numpy as np
def _estimate_visib_mask(d_test, d_model, delta, visib_mode='bop19'):
"""Estimates a mask of the visible object surface.
:param d... | en | 0.863666 | # Author: <NAME> (<EMAIL>) # Center for Machine Perception, Czech Technical University in Prague Estimation of the visible object surface from depth images. Estimates a mask of the visible object surface. :param d_test: Distance image of a scene in which the visibility is estimated. :param d_model: Rendered distan... | 2.791266 | 3 |
tools.py | n3llo/test_dinasty | 0 | 6630263 | <gh_stars>0
'''
Package for the automatic computing of scores and rankings for the Play.it Dinasty keeper league
<NAME> (<EMAIL>)
'''
import argparse
import os
import tools
def parse_arguments():
'''
Parse arguments
'''
# Initialize parser
parser = argparse.ArgumentParser()
# Parse argume... | '''
Package for the automatic computing of scores and rankings for the Play.it Dinasty keeper league
<NAME> (<EMAIL>)
'''
import argparse
import os
import tools
def parse_arguments():
'''
Parse arguments
'''
# Initialize parser
parser = argparse.ArgumentParser()
# Parse arguments
pars... | en | 0.638718 | Package for the automatic computing of scores and rankings for the Play.it Dinasty keeper league <NAME> (<EMAIL>) Parse arguments # Initialize parser # Parse arguments Create file and folder names Create directory if it does not exist yet | 2.99371 | 3 |
examples/request_init_listener.py | clohfink/python-driver | 1,163 | 6630264 | <gh_stars>1000+
#!/usr/bin/env python
# Copyright DataStax, 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 by applicab... | #!/usr/bin/env python
# Copyright DataStax, 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 by applicable law or agreed... | en | 0.774112 | #!/usr/bin/env python # Copyright DataStax, 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 by applicable law or agreed... | 2.251937 | 2 |
metachecker/routes/meta.py | art101nft/metachecker | 2 | 6630265 | import requests
from flask import Blueprint, render_template
from flask import redirect, url_for
from flask_login import logout_user, login_required
from metachecker import config
bp = Blueprint('meta', 'meta')
@bp.route('/about')
def about():
return render_template('about.html')
@bp.route('/disconnect')
def... | import requests
from flask import Blueprint, render_template
from flask import redirect, url_for
from flask_login import logout_user, login_required
from metachecker import config
bp = Blueprint('meta', 'meta')
@bp.route('/about')
def about():
return render_template('about.html')
@bp.route('/disconnect')
def... | none | 1 | 2.014569 | 2 | |
PythonDesafios/d029.py | adaatii/Python-Curso-em-Video- | 0 | 6630266 | <reponame>adaatii/Python-Curso-em-Video-
#Escreva um programa que leia a velocidade de um carro.
# Se ele ultrapassar 80Km/h, mostre uma mensagem dizendo
# que ele foi multado. A multa vai custar R$7,00 por cada
# Km acima do limite.
velo = float(input('Qual a velocidade do carro? '))
if velo > 80:
print('Multado!... | #Escreva um programa que leia a velocidade de um carro.
# Se ele ultrapassar 80Km/h, mostre uma mensagem dizendo
# que ele foi multado. A multa vai custar R$7,00 por cada
# Km acima do limite.
velo = float(input('Qual a velocidade do carro? '))
if velo > 80:
print('Multado! voce excedeu o limite de 80km/h')
mu... | pt | 0.99544 | #Escreva um programa que leia a velocidade de um carro. # Se ele ultrapassar 80Km/h, mostre uma mensagem dizendo # que ele foi multado. A multa vai custar R$7,00 por cada # Km acima do limite. | 3.873431 | 4 |
qcloudsdkcam/AttachUserPoliciesRequest.py | f3n9/qcloudcli | 0 | 6630267 | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class AttachUserPoliciesRequest(Request):
def __init__(self):
super(AttachUserPoliciesRequest, self).__init__(
'cam', 'qcloudcliV1', 'AttachUserPolicies', 'cam.api.qcloud.com')
def get_uin(self):
return self.get_pa... | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class AttachUserPoliciesRequest(Request):
def __init__(self):
super(AttachUserPoliciesRequest, self).__init__(
'cam', 'qcloudcliV1', 'AttachUserPolicies', 'cam.api.qcloud.com')
def get_uin(self):
return self.get_pa... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.841276 | 2 |
benchmarks/benchmark_files.py | devincornell/sqlitedocuments | 1 | 6630268 | <gh_stars>1-10
#from .doctable import DocTable, DocTableRow
#from .util import Timer
import sys
sys.path.append('..')
import doctable
import pickle
import os
import typing
from dataclasses import dataclass, field
import random
import time
@doctable.schema(require_slots=False)
class TestObjBase:
idx: int = doctabl... | #from .doctable import DocTable, DocTableRow
#from .util import Timer
import sys
sys.path.append('..')
import doctable
import pickle
import os
import typing
from dataclasses import dataclass, field
import random
import time
@doctable.schema(require_slots=False)
class TestObjBase:
idx: int = doctable.IDCol()
si... | fa | 0.095698 | #from .doctable import DocTable, DocTableRow #from .util import Timer #timer.print_table() | 2.373705 | 2 |
backend/app.py | cbaron3/safewalks.io | 1 | 6630269 | <filename>backend/app.py<gh_stars>1-10
from flask import Flask, request, jsonify, make_response
import googlemaps
from datetime import datetime
import secrets
import json
import operator
import opendata
import urllib.request
import requests
import types
# Handling cross origin resource handling
# declare constants
H... | <filename>backend/app.py<gh_stars>1-10
from flask import Flask, request, jsonify, make_response
import googlemaps
from datetime import datetime
import secrets
import json
import operator
import opendata
import urllib.request
import requests
import types
# Handling cross origin resource handling
# declare constants
H... | en | 0.771797 | # Handling cross origin resource handling # declare constants # initialize flask application # Google maps client # Debug variable # Safest path # Usage: IP:HOST/api/path?from=LAT,LON&to=LAT,LON # Example: http://0.0.0.0:5000/api/path?from=43.004663,-81.276361&to=248 Trott Dr # Grab data from requests #print(start) # Q... | 2.779415 | 3 |
mlcomp/contrib/catalyst/register.py | sUeharaE4/mlcomp | 0 | 6630270 | from catalyst.dl import registry
from catalyst.contrib.models.segmentation import (
Unet, ResnetLinknet, MobileUnet, ResnetUnet, ResnetFPNUnet, ResnetPSPnet,
FPNUnet, Linknet, PSPnet,
ResNetLinknet)
from mlcomp.contrib.criterion import RingLoss
from mlcomp.contrib.catalyst.callbacks.inference import InferB... | from catalyst.dl import registry
from catalyst.contrib.models.segmentation import (
Unet, ResnetLinknet, MobileUnet, ResnetUnet, ResnetFPNUnet, ResnetPSPnet,
FPNUnet, Linknet, PSPnet,
ResNetLinknet)
from mlcomp.contrib.criterion import RingLoss
from mlcomp.contrib.catalyst.callbacks.inference import InferB... | en | 0.652533 | # classification # segmentation | 1.874459 | 2 |
math/numberTheory/euler.py | snowflying/algorithm-in-python | 1 | 6630271 | #coding: utf-8
''' mbinary
#######################################################################
# File : euler.py
# Author: mbinary
# Mail: <EMAIL>
# Blog: https://mbinary.xyz
# Github: https://github.com/mbinary
# Created Time: 2018-12-16 10:53
# Description:
euler function: phi(n)
perfect num: \sigma ... | #coding: utf-8
''' mbinary
#######################################################################
# File : euler.py
# Author: mbinary
# Mail: <EMAIL>
# Blog: https://mbinary.xyz
# Github: https://github.com/mbinary
# Created Time: 2018-12-16 10:53
# Description:
euler function: phi(n)
perfect num: \sigma ... | de | 0.370576 | #coding: utf-8 mbinary ####################################################################### # File : euler.py # Author: mbinary # Mail: <EMAIL> # Blog: https://mbinary.xyz # Github: https://github.com/mbinary # Created Time: 2018-12-16 10:53 # Description: euler function: phi(n) perfect num: \sigma (n) ... | 3.464021 | 3 |
comparator.py | vybhavjain/SPEECH_IMAGE_FINAL | 0 | 6630272 | <reponame>vybhavjain/SPEECH_IMAGE_FINAL
import turtle
import fcomponent as fc
def start(r): # Horizontal Oval
turtle.penup()
turtle.setpos(0,60)
turtle.pendown()
turtle.penup()
turtle.setpos(-(r/1.414),60+(r/1.414))
turtle.pendown()
turtle.write(" Start")
turtle.right... | import turtle
import fcomponent as fc
def start(r): # Horizontal Oval
turtle.penup()
turtle.setpos(0,60)
turtle.pendown()
turtle.penup()
turtle.setpos(-(r/1.414),60+(r/1.414))
turtle.pendown()
turtle.write(" Start")
turtle.right(45)
for loop in range(2):
t... | en | 0.874365 | # Horizontal Oval # Horizontal Oval # function to print the start inside the oval # makes pen disappear in the current block only # makes pen disappear in the current block only # draws a rhombus for the conditional statement # code if comparison is true # results of comparison is true # code if comparison is flase #re... | 4.01808 | 4 |
pyelf/structs64.py | guilload/pyelf | 3 | 6630273 | from .enums import *
from .flags import *
from .structure import Structure
Elf64_Addr = 'Q'
Elf64_Byte = 'B'
Elf64_Half = 'H'
Elf64_Off = 'Q'
Elf64_SHalf = 'h'
Elf64_Sword = 'i'
Elf64_Sxword = 'q'
Elf64_Word = 'I'
Elf64_Xword = 'Q'
class Elf64_Ehdr(Structure):
"""
File header.
"""
members = ({'name'... | from .enums import *
from .flags import *
from .structure import Structure
Elf64_Addr = 'Q'
Elf64_Byte = 'B'
Elf64_Half = 'H'
Elf64_Off = 'Q'
Elf64_SHalf = 'h'
Elf64_Sword = 'i'
Elf64_Sxword = 'q'
Elf64_Word = 'I'
Elf64_Xword = 'Q'
class Elf64_Ehdr(Structure):
"""
File header.
"""
members = ({'name'... | en | 0.787254 | File header. Section header. Program header. Symbol section entry. 'SHT_REL' relocation section entry. 'SHT_RELA' relocation section entry. Dynamic section entry. # TODO: there're more d_types to deal with | 2.091531 | 2 |
src/memote/support/biomass.py | Midnighter/memote | 0 | 6630274 | # -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | # -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | en | 0.858191 | # -*- coding: utf-8 -*- # Copyright 2017 Novo Nordisk Foundation Center for Biosustainability, # Technical University of Denmark. # # 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:... | 1.877881 | 2 |
_unittests/ut_onnxrt/test_rt_valid_model_onevsrest_classifier.py | henrywu2019/mlprodict | 1 | 6630275 | """
@brief test log(time=4s)
"""
import unittest
from logging import getLogger
from pandas import DataFrame
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase
from pyquickhelper.pandashelper import df2rst
from sklearn.exceptions import ConvergenceWarning
try:
from sklearn.uti... | """
@brief test log(time=4s)
"""
import unittest
from logging import getLogger
from pandas import DataFrame
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase
from pyquickhelper.pandashelper import df2rst
from sklearn.exceptions import ConvergenceWarning
try:
from sklearn.uti... | en | 0.452621 | @brief test log(time=4s) | 2.420161 | 2 |
kitt/dataloading/mapping.py | spirali/k | 2 | 6630276 | <filename>kitt/dataloading/mapping.py
def create_tuple_mapper(input_fn, output_fn):
"""
Creates a mapping function that receives a tuple (input, output) and uses the two
provided functions to return tuple (input_fn(input), output_fn(output)).
"""
def fun(item):
input, output = item
... | <filename>kitt/dataloading/mapping.py
def create_tuple_mapper(input_fn, output_fn):
"""
Creates a mapping function that receives a tuple (input, output) and uses the two
provided functions to return tuple (input_fn(input), output_fn(output)).
"""
def fun(item):
input, output = item
... | en | 0.611806 | Creates a mapping function that receives a tuple (input, output) and uses the two provided functions to return tuple (input_fn(input), output_fn(output)). | 3.360691 | 3 |
agent_stable_baselines/stable_baselines/ddpg/main.py | Jannkar/doom_actionspace | 1 | 6630277 | import argparse
import time
import os
import gym
import tensorflow as tf
import numpy as np
from mpi4py import MPI
from stable_baselines import logger, bench
from stable_baselines.common.misc_util import set_global_seeds, boolean_flag
from stable_baselines.ddpg.policies import MlpPolicy, LnMlpPolicy
from ... | import argparse
import time
import os
import gym
import tensorflow as tf
import numpy as np
from mpi4py import MPI
from stable_baselines import logger, bench
from stable_baselines.common.misc_util import set_global_seeds, boolean_flag
from stable_baselines.ddpg.policies import MlpPolicy, LnMlpPolicy
from ... | en | 0.68398 | run the training of DDPG
:param env_id: (str) the environment ID
:param seed: (int) the initial random seed
:param noise_type: (str) the wanted noises ('adaptive-param', 'normal' or 'ou'), can use multiple noise type by
seperating them with commas
:param layer_norm: (bool) use layer norma... | 2.220142 | 2 |
synapse/storage/schema/main/delta/61/03recreate_min_depth.py | mlakkadshaw/synapse | 9,945 | 6630278 | # Copyright 2021 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2021 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | en | 0.714647 | # Copyright 2021 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a... | 2.163694 | 2 |
API/moviepiapi/CastingList.py | theoarmengou/MoviePi | 1 | 6630279 | <filename>API/moviepiapi/CastingList.py<gh_stars>1-10
##
# EPITECH PROJECT, 2019
# MoviePi
# File description:
# actorList.py
##
from flask_restful import Resource
from moviepiapi.utils import fill_return_packet, db
from flask import request
############################################################################... | <filename>API/moviepiapi/CastingList.py<gh_stars>1-10
##
# EPITECH PROJECT, 2019
# MoviePi
# File description:
# actorList.py
##
from flask_restful import Resource
from moviepiapi.utils import fill_return_packet, db
from flask import request
############################################################################... | de | 0.533493 | ## # EPITECH PROJECT, 2019 # MoviePi # File description: # actorList.py ## ############################################################################### # CASTING LIST # # DOC : DOCUMENTATION/CASTINGLIST.MD # #####... | 2.954164 | 3 |
implementations/python/mzlib/tools/cli.py | wulongict/mzSpecLib | 0 | 6630280 | import click
from mzlib.spectrum_library import SpectrumLibrary
from mzlib.index import MemoryIndex, SQLIndex
from mzlib.backends.text import TextSpectralLibraryWriter
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group(context_settings=CONTEXT_SETTINGS)
def main():
'''A collection of utili... | import click
from mzlib.spectrum_library import SpectrumLibrary
from mzlib.index import MemoryIndex, SQLIndex
from mzlib.backends.text import TextSpectralLibraryWriter
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group(context_settings=CONTEXT_SETTINGS)
def main():
'''A collection of utili... | en | 0.801284 | A collection of utilities for inspecting and manipulating spectral libraries. Produces a minimal textual description of a spectral library. Convert a spectral library from one format to another. If `outpath` is `-`, instead of writing to file, data will instead be sent to STDOUT. | 2.271386 | 2 |
databricks_utils/vega.py | e2fyi/databricks-utils | 1 | 6630281 |
"""
Basic vega functions to plot vega charts in databricks or jupyter notebooks.
.. moduleauthor:: <EMAIL>
"""
import json
DEFAULT_VEGA_OPTS = dict(theme="quartz",
defaultStyle=True,
actions=dict(export=True,
source=True,
... |
"""
Basic vega functions to plot vega charts in databricks or jupyter notebooks.
.. moduleauthor:: <EMAIL>
"""
import json
DEFAULT_VEGA_OPTS = dict(theme="quartz",
defaultStyle=True,
actions=dict(export=True,
source=True,
... | en | 0.394517 | Basic vega functions to plot vega charts in databricks or jupyter notebooks. .. moduleauthor:: <EMAIL> Default settings for `vega-embed` (See `https://github.com/vega/vega-embed`). Display a vega chart. Also return the HTML to display the vega chart. :param display: Callable to render the resultant HTML (e.g. dis... | 2.827508 | 3 |
hackabot/quiz.py | Bulichek/pepequestbot | 0 | 6630282 | <gh_stars>0
Quizes = [
("Какую долю ваших расходов за месяц занимает косметика?",
["10% (5000 ₽)",
"5% (2500 ₽)",
"21% (10500 ₽)",
"13% (6500 ₽)"],
0),
("Назовите максимальную сумму, которую Вы тратили за раз в одном из магазинов:",
["15200 ₽",
"3840 ₽",
"7340 ₽",
... | Quizes = [
("Какую долю ваших расходов за месяц занимает косметика?",
["10% (5000 ₽)",
"5% (2500 ₽)",
"21% (10500 ₽)",
"13% (6500 ₽)"],
0),
("Назовите максимальную сумму, которую Вы тратили за раз в одном из магазинов:",
["15200 ₽",
"3840 ₽",
"7340 ₽",
"2710 ₽"... | none | 1 | 2.231864 | 2 | |
Chess Bot.py | life-elevated/ChessBot | 0 | 6630283 | <reponame>life-elevated/ChessBot<gh_stars>0
#minimax
import pygame, sys, time
from pygame.locals import *
import time
import pygame.gfxdraw
boardString = "" # 1=whitespace 2=blackspace 3=user 4=computer 5=selected
sizeBase = 600
rowcount = 10 # Adjust this to set the size of the board, must be divisible by 2
tileMea... | #minimax
import pygame, sys, time
from pygame.locals import *
import time
import pygame.gfxdraw
boardString = "" # 1=whitespace 2=blackspace 3=user 4=computer 5=selected
sizeBase = 600
rowcount = 10 # Adjust this to set the size of the board, must be divisible by 2
tileMeasurements = sizeBase/rowcount
if tileMeasure... | en | 0.930689 | #minimax # 1=whitespace 2=blackspace 3=user 4=computer 5=selected # Adjust this to set the size of the board, must be divisible by 2 # Set who goes first here. This is changed by switch_player() after every turn. # The scorecard #pygame.draw.circle(black_circle,black,(x.centerx+tileMeasurements,x.centery/2),15) # Find ... | 3.054881 | 3 |
examples/applications/semantic_search_quora_annoy.py | zhangxieyang2/sentence-transformers | 1 | 6630284 | <filename>examples/applications/semantic_search_quora_annoy.py
"""
This example uses Approximate Nearest Neighbor Search (ANN) with Annoy (https://github.com/spotify/annoy).
Searching a large corpus with Millions of embeddings can be time-consuming. To speed this up,
ANN can index the existent vectors. For a new query... | <filename>examples/applications/semantic_search_quora_annoy.py
"""
This example uses Approximate Nearest Neighbor Search (ANN) with Annoy (https://github.com/spotify/annoy).
Searching a large corpus with Millions of embeddings can be time-consuming. To speed this up,
ANN can index the existent vectors. For a new query... | en | 0.843108 | This example uses Approximate Nearest Neighbor Search (ANN) with Annoy (https://github.com/spotify/annoy). Searching a large corpus with Millions of embeddings can be time-consuming. To speed this up, ANN can index the existent vectors. For a new query vector, this index can be used to find the nearest neighbors. Thi... | 3.041238 | 3 |
packages/python/plotly/plotly/validators/carpet/baxis/__init__.py | sgn/plotly.py | 3 | 6630285 | <reponame>sgn/plotly.py
import _plotly_utils.basevalidators
class TypeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="type", parent_name="carpet.baxis", **kwargs):
super(TypeValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | import _plotly_utils.basevalidators
class TypeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="type", parent_name="carpet.baxis", **kwargs):
super(TypeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | en | 0.803403 | font Sets this axis' title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute. offset An additional amount by which to offset the title from the tick labels, given in pixels. ... | 2.333595 | 2 |
pysen/factory.py | linshoK/pysen | 423 | 6630286 | <gh_stars>100-1000
import dataclasses
import pathlib
from typing import Dict, List, Optional
from .black import Black, BlackSetting
from .component import ComponentBase
from .flake8 import Flake8, Flake8Setting
from .isort import Isort, IsortSectionName, IsortSetting
from .mypy import (
Mypy,
MypyFollowImports... | import dataclasses
import pathlib
from typing import Dict, List, Optional
from .black import Black, BlackSetting
from .component import ComponentBase
from .flake8 import Flake8, Flake8Setting
from .isort import Isort, IsortSectionName, IsortSetting
from .mypy import (
Mypy,
MypyFollowImports,
MypyPlugin,
... | en | 0.817744 | # NOTE: `isort` may format code in a way that violates `black` rules # Apply `isort` after `black` to avoid such violation | 1.991251 | 2 |
server_lifecycle.py | pauliacomi/separation-explorer | 11 | 6630287 | from threading import Thread
import src.datastore
def on_server_loaded(server_context):
''' If present, this function is called when the server first starts. '''
t = Thread(target=src.datastore.load, args=())
t.setDaemon(True)
t.start()
def on_server_unloaded(server_context):
''' If present, th... | from threading import Thread
import src.datastore
def on_server_loaded(server_context):
''' If present, this function is called when the server first starts. '''
t = Thread(target=src.datastore.load, args=())
t.setDaemon(True)
t.start()
def on_server_unloaded(server_context):
''' If present, th... | en | 0.939666 | If present, this function is called when the server first starts. If present, this function is called when the server shuts down. If present, this function is called when a session is created. If present, this function is called when a session is closed. | 2.968932 | 3 |
INBa/2014/MOCHALOV_V_V/task_2_15.py | YukkaSarasti/pythonintask | 0 | 6630288 | <filename>INBa/2014/MOCHALOV_V_V/task_2_15.py
# Задача 2. Вариант 15.
# Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Плутарх. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
# Mochalov V. V.
# 02.03.2016
print("Два ... | <filename>INBa/2014/MOCHALOV_V_V/task_2_15.py
# Задача 2. Вариант 15.
# Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Плутарх. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
# Mochalov V. V.
# 02.03.2016
print("Два ... | ru | 0.997321 | # Задача 2. Вариант 15. # Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Плутарх. Не забудьте о том, что автор должен быть упомянут на отдельной строке. # Mochalov V. V. # 02.03.2016 | 2.225796 | 2 |
authenticate/views.py | ockibagusp/cloud-platform | 1 | 6630289 | import jwt
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from authenticate.forms import SuperNodeAuthForm, UserAuthForm
from authenticate.utils import supernode_jwt_payload_handler, user_jwt_payload_handler
from authenticate.serializers import Us... | import jwt
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from authenticate.forms import SuperNodeAuthForm, UserAuthForm
from authenticate.utils import supernode_jwt_payload_handler, user_jwt_payload_handler
from authenticate.serializers import Us... | en | 0.937162 | Create token if user credentials was provided and valid. Create token if node credentials was provided and valid. | 2.307822 | 2 |
practica_kmedias/esqueleto_kmeans.py | binary-hideout/sistemas-adaptativos | 0 | 6630290 | <filename>practica_kmedias/esqueleto_kmeans.py
'''
INSTRUCCIONES: Completa la primera iteracion de k-medias. Para ello, utiliza la siguiente informacion y el esqueleto que a continuacion se te presenta.
'''
from math import sqrt
from sys import float_info
from random import randint
def calcularDistanciaEuclideana(pun... | <filename>practica_kmedias/esqueleto_kmeans.py
'''
INSTRUCCIONES: Completa la primera iteracion de k-medias. Para ello, utiliza la siguiente informacion y el esqueleto que a continuacion se te presenta.
'''
from math import sqrt
from sys import float_info
from random import randint
def calcularDistanciaEuclideana(pun... | es | 0.930229 | INSTRUCCIONES: Completa la primera iteracion de k-medias. Para ello, utiliza la siguiente informacion y el esqueleto que a continuacion se te presenta. (A) Primer funcion a completar Entradas: puntoA y puntoB -- son listas numericas de cualquier longitud (debe ser la misma longitud en ambas listas). Salida: Di... | 3.151297 | 3 |
app/models/adapters/helpers/node.py | mobile2015/neoPyth | 0 | 6630291 | <filename>app/models/adapters/helpers/node.py
__author__ = 'rikkt0r'
class Node:
def __init__(self, node):
self.node = node
@property
def serialize(self):
return {
"id": self.node.id,
"name": self.node.name
} | <filename>app/models/adapters/helpers/node.py
__author__ = 'rikkt0r'
class Node:
def __init__(self, node):
self.node = node
@property
def serialize(self):
return {
"id": self.node.id,
"name": self.node.name
} | none | 1 | 2.313192 | 2 | |
wallet/test/helpers/metamask.py | EYBlockchain/nightfall_3 | 107 | 6630292 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from .find_elements import *
from time import sleep
def initializeMetamask(driver, findElements, metamaskConfig):
# Load metamask, check if the account is already set up
firstT... | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from .find_elements import *
from time import sleep
def initializeMetamask(driver, findElements, metamaskConfig):
# Load metamask, check if the account is already set up
firstT... | en | 0.340234 | # Load metamask, check if the account is already set up ####################### # Set up the metamask # ####################### # Import wallet # Agree terms # Seed phrase # Password # Repeat password # Read agreements ( for sure) # Read agreements ( for sure) # All Done button # Accept all the emerging popups of the f... | 2.575806 | 3 |
backend-service/visits-service/app/app/db/base.py | abhishek70/python-petclinic-microservices | 2 | 6630293 | <filename>backend-service/visits-service/app/app/db/base.py<gh_stars>1-10
# Import all the models, so that Base has them before being
# imported by Alembic
from ..models.visit import Visit # noqa
from .base_class import Base # noqa
| <filename>backend-service/visits-service/app/app/db/base.py<gh_stars>1-10
# Import all the models, so that Base has them before being
# imported by Alembic
from ..models.visit import Visit # noqa
from .base_class import Base # noqa
| en | 0.951317 | # Import all the models, so that Base has them before being # imported by Alembic # noqa # noqa | 1.361224 | 1 |
frontend.py | milonoir/yaml_rulz_frontend | 0 | 6630294 | from flask import Flask
from flask import request
from flask import render_template
from flask_wtf.csrf import CSRFProtect
from flask_wtf import FlaskForm
from wtforms import TextAreaField
from wtforms.validators import DataRequired
from yaml_rulz.validator import YAMLValidator
app = Flask(__name__)
csrf = CSRFProtect... | from flask import Flask
from flask import request
from flask import render_template
from flask_wtf.csrf import CSRFProtect
from flask_wtf import FlaskForm
from wtforms import TextAreaField
from wtforms.validators import DataRequired
from yaml_rulz.validator import YAMLValidator
app = Flask(__name__)
csrf = CSRFProtect... | none | 1 | 2.503997 | 3 | |
genome_integration/resources/get_ensembl_gene_information.py | adriaan-vd-graaf/genome_integration | 13 | 6630295 | from genome_integration import gene_regions
import gzip
"""
These classes are intended to easily access and query ensembl genes information,
But they have other uses as well, so it is possible that these will be joined with the ensembl
"""
class EnsemblGene(gene_regions.StartEndRegion):
"""
Contains all the... | from genome_integration import gene_regions
import gzip
"""
These classes are intended to easily access and query ensembl genes information,
But they have other uses as well, so it is possible that these will be joined with the ensembl
"""
class EnsemblGene(gene_regions.StartEndRegion):
"""
Contains all the... | en | 0.774035 | These classes are intended to easily access and query ensembl genes information, But they have other uses as well, so it is possible that these will be joined with the ensembl Contains all the standard fields for gene information from ensembl. Attributes ---------- ensg_id: str ensembl id gen... | 2.94819 | 3 |
lib/sedna/algorithms/unseen_task_detect/unseen_task_detect.py | chou-shun/sedna | 0 | 6630296 | <gh_stars>0
# Copyright 2021 The KubeEdge Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright 2021 The KubeEdge Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | en | 0.836428 | # Copyright 2021 The KubeEdge Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in... | 2.14575 | 2 |
ee_api/__init__.py | dgketchum/MT_RSense | 0 | 6630297 | import ee
def is_authorized():
try:
ee.Initialize()
print('Authorized')
except Exception as e:
print('You are not authorized: {}'.format(e))
exit(1)
return None
if __name__ == '__main__':
pass
# ========================= EOF ===========================================... | import ee
def is_authorized():
try:
ee.Initialize()
print('Authorized')
except Exception as e:
print('You are not authorized: {}'.format(e))
exit(1)
return None
if __name__ == '__main__':
pass
# ========================= EOF ===========================================... | en | 0.354309 | # ========================= EOF ==================================================================== | 2.676602 | 3 |
scripts/check_pipfile_and_toxini.py | BuildJet/agents-aea | 1 | 6630298 | <filename>scripts/check_pipfile_and_toxini.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exc... | <filename>scripts/check_pipfile_and_toxini.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exc... | en | 0.740296 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ma... | 2.182487 | 2 |
scheduled_bots/drugs/pharma/Mixtures.py | turoger/scheduled-bots | 6 | 6630299 | <filename>scheduled_bots/drugs/pharma/Mixtures.py
"""
create drug/product mixtures
Example: https://www.wikidata.org/wiki/Q4663143
"""
import time
from collections import defaultdict
from wikidataintegrator import wdi_core, wdi_login, wdi_helpers
from scheduled_bots.local import WDPASS, WDUSER
def make_ref(rxnorm)... | <filename>scheduled_bots/drugs/pharma/Mixtures.py
"""
create drug/product mixtures
Example: https://www.wikidata.org/wiki/Q4663143
"""
import time
from collections import defaultdict
from wikidataintegrator import wdi_core, wdi_login, wdi_helpers
from scheduled_bots.local import WDPASS, WDUSER
def make_ref(rxnorm)... | en | 0.660315 | create drug/product mixtures Example: https://www.wikidata.org/wiki/Q4663143 # stated in rxnorm # rxcui # retrieved SELECT distinct ?drug ?compound WHERE { values ?chemical {wd:Q12140 wd:Q11173 wd:Q79529} ?drug wdt:P527 ?compound . ?drug wdt:P31 ?chemical . ?compound wdt... | 2.735621 | 3 |
excepthook.py | wildbeez/SmokeDetector | 0 | 6630300 | # coding=utf-8
from datetime import datetime
import os
import traceback
import threading
import sys
# noinspection PyPackageRequirements
from websocket import WebSocketConnectionClosedException
import requests
from helpers import log, log_exception
from globalvars import GlobalVars
# noinspection PyProtectedMember
de... | # coding=utf-8
from datetime import datetime
import os
import traceback
import threading
import sys
# noinspection PyPackageRequirements
from websocket import WebSocketConnectionClosedException
import requests
from helpers import log, log_exception
from globalvars import GlobalVars
# noinspection PyProtectedMember
de... | en | 0.522295 | # coding=utf-8 # noinspection PyPackageRequirements # noinspection PyProtectedMember Workaround for sys.excepthook thread bug From http://spyced.blogspot.com/2007/06/workaround-for-sysexcepthook-bug.html (https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1230540&group_id=5470). Call once from... | 1.890899 | 2 |
uni_parser/ebnf/ebnf_ast.py | nonemaw/YeTi | 1 | 6630301 | class Ast:
def __init__(self, name: str, token_position: tuple, grammars: list = None,
grammar: str = None):
"""
I am an AST tree, grammars are my children
`grammars` can be both a spelling string, or a list of Ast instance
"""
# matched grammar object name
... | class Ast:
def __init__(self, name: str, token_position: tuple, grammars: list = None,
grammar: str = None):
"""
I am an AST tree, grammars are my children
`grammars` can be both a spelling string, or a list of Ast instance
"""
# matched grammar object name
... | en | 0.726645 | I am an AST tree, grammars are my children `grammars` can be both a spelling string, or a list of Ast instance # matched grammar object name # (line_start, char_start, line_end, char_end) # child case (single grammar case, e.g. a matched literal grammar) # children case (a list of various grammars) | 3.492293 | 3 |
src/template_finder.py | OppOeds/botty | 0 | 6630302 | import cv2
from screen import Screen
from typing import Tuple, Union, List
import numpy as np
from logger import Logger
import time
import os
from config import Config
from utils.misc import load_template
class TemplateFinder:
def __init__(self, screen: Screen, scale_factor: float = None):
"""
:pa... | import cv2
from screen import Screen
from typing import Tuple, Union, List
import numpy as np
from logger import Logger
import time
import os
from config import Config
from utils.misc import load_template
class TemplateFinder:
def __init__(self, screen: Screen, scale_factor: float = None):
"""
:pa... | en | 0.805381 | :param screen: Screen object :param scale_factor: Scale factor that is used for templates. Note: UI and NPC templates will always have scale of 1.0 # Templates for node in A5 Town # Templates for nod at Pindle # Templates for nodes to Eldritch # Templates for nodes to Shenk (from Eldritch) # Template Selectable... | 2.439086 | 2 |
graphnas/gnn_model_manager.py | GraphNAS/GraphNAS | 94 | 6630303 | import os
import time
import numpy as np
import torch
import torch.nn.functional as F
from dgl import DGLGraph
from dgl.data import load_data
from graphnas.gnn import GraphNet
from graphnas.utils.model_utils import EarlyStop, TopAverage, process_action
def load(args, save_file=".npy"):
save_file = args.dataset ... | import os
import time
import numpy as np
import torch
import torch.nn.functional as F
from dgl import DGLGraph
from dgl.data import load_data
from graphnas.gnn import GraphNet
from graphnas.utils.model_utils import EarlyStop, TopAverage, process_action
def load(args, save_file=".npy"):
save_file = args.dataset ... | en | 0.475434 | # manager the train process of GNN on citation dataset # don't share param # don't share param # train from scratch # create model # use optimizer # train from scratch # create model # use optimizer # with open(f'{self.args.dataset}_{self.args.search_mode}_{self.args.format}_manager_result.txt', "a") as file: # forward... | 2.284593 | 2 |
tests/ea/selection/selector/select/select_2/case_data.py | stevenbennett96/stk | 21 | 6630304 | <filename>tests/ea/selection/selector/select/select_2/case_data.py
class CaseData:
"""
A test case.
Attributes
----------
selector : :class:`.Selector`
The selector to test.
population : :class:`tuple` of :class:`.MoleculeRecord`
The population from which batches are selected.
... | <filename>tests/ea/selection/selector/select/select_2/case_data.py
class CaseData:
"""
A test case.
Attributes
----------
selector : :class:`.Selector`
The selector to test.
population : :class:`tuple` of :class:`.MoleculeRecord`
The population from which batches are selected.
... | en | 0.657115 | A test case. Attributes ---------- selector : :class:`.Selector` The selector to test. population : :class:`tuple` of :class:`.MoleculeRecord` The population from which batches are selected. selected : :class:`tuple` of :class:`.Batch` The batches which should be selec... | 2.802844 | 3 |
testing/mongo_ins_del_loop.py | Rippling/mongoproxy | 19 | 6630305 | <gh_stars>10-100
import pymongo
con = pymongo.MongoClient("mongodb://localhost:27111")
bigcollection = con['test']['bigcollection']
while True:
print "Inserting"
for i in range(1000):
bigcollection.insert_one({ "a": "bbbbbbbbbbbbbbbbbbbb", "b": "CCCCCCCCCCCCCCCCCC"})
print "Removing"
res = bigc... | import pymongo
con = pymongo.MongoClient("mongodb://localhost:27111")
bigcollection = con['test']['bigcollection']
while True:
print "Inserting"
for i in range(1000):
bigcollection.insert_one({ "a": "bbbbbbbbbbbbbbbbbbbb", "b": "CCCCCCCCCCCCCCCCCC"})
print "Removing"
res = bigcollection.delete_... | none | 1 | 2.795352 | 3 | |
tests/commands/autoupdate_test.py | MahmoudHussien/pre-commit | 0 | 6630306 | from __future__ import unicode_literals
import pipes
import pytest
import pre_commit.constants as C
from pre_commit import git
from pre_commit.commands.autoupdate import _check_hooks_still_exist_at_rev
from pre_commit.commands.autoupdate import autoupdate
from pre_commit.commands.autoupdate import RepositoryCannotBe... | from __future__ import unicode_literals
import pipes
import pytest
import pre_commit.constants as C
from pre_commit import git
from pre_commit.commands.autoupdate import _check_hooks_still_exist_at_rev
from pre_commit.commands.autoupdate import autoupdate
from pre_commit.commands.autoupdate import RepositoryCannotBe... | en | 0.880524 | # change the default branch to be not-master In $FUTURE_VERSION, hooks.yaml will no longer be supported. This asserts that when that day comes, pre-commit will be able to autoupdate despite not being able to read hooks.yaml in that repository. # Assume this is the revision the user's old repository was at # It... | 1.877319 | 2 |
03_Day_Operators/21.py | diegofregolente/30-Days-Of-Python | 0 | 6630307 | hours = float(input('Hours: '))
rate = float(input('Rate per hour: '))
pay = hours * rate
print('Weekly earning is ', pay) # 21
| hours = float(input('Hours: '))
rate = float(input('Rate per hour: '))
pay = hours * rate
print('Weekly earning is ', pay) # 21
| none | 1 | 3.956808 | 4 | |
weakened_algorithm/run_visualizations.py | jessicawang225/caltech-ee148-spring2020-hw02 | 0 | 6630308 | <reponame>jessicawang225/caltech-ee148-spring2020-hw02<filename>weakened_algorithm/run_visualizations.py
import json
import numpy as np
from PIL import Image, ImageDraw
import os
def draw(I, boxes):
for box in boxes:
draw = ImageDraw.Draw(I)
# Draw bounding box in neon yellow
top, left, bo... | import json
import numpy as np
from PIL import Image, ImageDraw
import os
def draw(I, boxes):
for box in boxes:
draw = ImageDraw.Draw(I)
# Draw bounding box in neon yellow
top, left, bottom, right = box[:4]
draw.rectangle([left, top, right, bottom], outline=(204, 255, 0))
d... | en | 0.808476 | # Draw bounding box in neon yellow # set the path to the downloaded data: # set a path for saving predictions: # set a path for saving visualizations: # load splits: # get bounding boxes # read image using PIL: # read image using PIL: | 2.737702 | 3 |
tf-gnn-samples/utils/add_child_ids.py | tech-srl/bottleneck | 56 | 6630309 | <reponame>tech-srl/bottleneck<filename>tf-gnn-samples/utils/add_child_ids.py
import pickle
from argparse import ArgumentParser
raw_keys = ['Child', 'NextToken', 'ComputedFrom', 'LastUse', 'LastWrite', 'LastLexicalUse', 'FormalArgName', 'GuardedBy', 'GuardedByNegation', 'UsesSubtoken']
if __name__ == '__main__':
p... | import pickle
from argparse import ArgumentParser
raw_keys = ['Child', 'NextToken', 'ComputedFrom', 'LastUse', 'LastWrite', 'LastLexicalUse', 'FormalArgName', 'GuardedBy', 'GuardedByNegation', 'UsesSubtoken']
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument("--edges", dest="edges", req... | en | 0.785429 | # if c is a parent itself | 2.711272 | 3 |
python/orthomcl/geneid2cluster.py | lotharwissler/bioinformatics | 10 | 6630310 | #!/usr/bin/python
import os, sys, string
from low import *
from orthomcl import OrthoMCLCluster
# =============================================================================
def usage():
print >> sys.stderr, "prints a mapping between each gene id and its cluster from orthomcl output\n"
print >> sys.stderr, "usa... | #!/usr/bin/python
import os, sys, string
from low import *
from orthomcl import OrthoMCLCluster
# =============================================================================
def usage():
print >> sys.stderr, "prints a mapping between each gene id and its cluster from orthomcl output\n"
print >> sys.stderr, "usa... | fr | 0.317879 | #!/usr/bin/python # ============================================================================= | 2.785269 | 3 |
src/spidery/spider/news/__init__.py | A2Media-id/spidery | 0 | 6630311 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import re
import traceback
from abc import abstractmethod, ABC
from typing import List
from bs4 import BeautifulSoup
from spidery.spider.engine import BaseCrawl
from spidery.spider.resource import DataNews, DataArticle
class NewsEngine(Base... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import re
import traceback
from abc import abstractmethod, ABC
from typing import List
from bs4 import BeautifulSoup
from spidery.spider.engine import BaseCrawl
from spidery.spider.resource import DataNews, DataArticle
class NewsEngine(Base... | en | 0.308914 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- | 2.445538 | 2 |
tests/test_edit_contact.py | AlreyQuin/python_training | 0 | 6630312 | # -*- coding: utf-8 -*-
from model.contact import Contact
import random
def test_edit_name(app, db, json_contacts, check_ui):
contact = json_contacts
if len(db.get_contact_list()) == 0:
app.contact.create(contact)
old_contact = db.get_contact_list()
c = random.choice(old_contact)
app.conta... | # -*- coding: utf-8 -*-
from model.contact import Contact
import random
def test_edit_name(app, db, json_contacts, check_ui):
contact = json_contacts
if len(db.get_contact_list()) == 0:
app.contact.create(contact)
old_contact = db.get_contact_list()
c = random.choice(old_contact)
app.conta... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.628039 | 3 |
mmtbx/conformation_dependent_library/multi_base_class.py | hbrunie/cctbx_project | 2 | 6630313 | <reponame>hbrunie/cctbx_project
from __future__ import absolute_import, division, print_function
from mmtbx.conformation_dependent_library.LinkedResidues import LinkedResidues
from mmtbx.conformation_dependent_library.cdl_utils import \
get_c_ca_n
from six.moves import range
def calc_pseudorotation(t0,t1,t2,t3,t4):
... | from __future__ import absolute_import, division, print_function
from mmtbx.conformation_dependent_library.LinkedResidues import LinkedResidues
from mmtbx.conformation_dependent_library.cdl_utils import \
get_c_ca_n
from six.moves import range
def calc_pseudorotation(t0,t1,t2,t3,t4):
import math
if t0 > 180.0: t... | en | 0.602065 | #JC hack #/JC #P = "%.1f" % P # for atom in atoms: print atom.quote() # for atom in atoms: print atom.quote() # Same as link_distance_cutoff of pdb_interpretation # if self[i-1] is None: # place holder for omega CDL # return False # if ccn1 is None: # for line in outl1: # if line not in self.errors: # sel... | 1.843688 | 2 |
neutron_tempest_plugin/scenario/test_qos.py | cloudification-io/neutron-tempest-plugin | 0 | 6630314 | <gh_stars>0
# Copyright 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | # Copyright 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | en | 0.887427 | # Copyright 2016 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by... | 1.726985 | 2 |
teamanalysis/water_2018.py | yoojunwoong/miniproject_self | 0 | 6630315 | <filename>teamanalysis/water_2018.py
import pandas as pd;
import numpy as np;
import json
from confing.settings import DATA_DIRS
df = pd.read_excel(DATA_DIRS[0] + '//health_2018.xlsx', engine='openpyxl');
dfh = df.copy();
# 행같은경우 1~18까지 데이터가 광역시별,도의 총통계로 되어있고,
# 열같은경우 물과 관련된 특정 데이터를 추출해야하는데, 특정값을 몰라서 (colunm1~... | <filename>teamanalysis/water_2018.py
import pandas as pd;
import numpy as np;
import json
from confing.settings import DATA_DIRS
df = pd.read_excel(DATA_DIRS[0] + '//health_2018.xlsx', engine='openpyxl');
dfh = df.copy();
# 행같은경우 1~18까지 데이터가 광역시별,도의 총통계로 되어있고,
# 열같은경우 물과 관련된 특정 데이터를 추출해야하는데, 특정값을 몰라서 (colunm1~... | ko | 0.896972 | # 행같은경우 1~18까지 데이터가 광역시별,도의 총통계로 되어있고, # 열같은경우 물과 관련된 특정 데이터를 추출해야하는데, 특정값을 몰라서 (colunm1~colunm4)로함 #dfc1 = dfc.loc[1:18,['colunm1','colunm2','colunm3','colunm4']]; #세종시에 데이터를 제외시키기 위해서, 세종시 위,아래 데이터(dfc1과 dfc2를 concat하였음) # 특정값(column1)에 대해서 NaN안 경우 값을 0.0으로하였음 #print(dfh3); #------------------------------------------... | 2.415797 | 2 |
Codes/gracekoo/interview_6.py | liuxiaohui1221/algorithm | 256 | 6630316 | # -*- coding: utf-8 -*-
# @Time: 2020/5/25 12:37
# @Author: GraceKoo
# @File: interview_6.py
# @Desc: https://www.nowcoder.com/practice/9f3231a991af4f55b95579b44b7a01ba?tpId=13&tqId=11159&tPage=1&rp=1&ru=/ta/
# coding-interviews&qru=/ta/coding-interviews/question-ranking
class Solution:
def minNumberInRotateArray... | # -*- coding: utf-8 -*-
# @Time: 2020/5/25 12:37
# @Author: GraceKoo
# @File: interview_6.py
# @Desc: https://www.nowcoder.com/practice/9f3231a991af4f55b95579b44b7a01ba?tpId=13&tqId=11159&tPage=1&rp=1&ru=/ta/
# coding-interviews&qru=/ta/coding-interviews/question-ranking
class Solution:
def minNumberInRotateArray... | en | 0.47457 | # -*- coding: utf-8 -*- # @Time: 2020/5/25 12:37 # @Author: GraceKoo # @File: interview_6.py # @Desc: https://www.nowcoder.com/practice/9f3231a991af4f55b95579b44b7a01ba?tpId=13&tqId=11159&tPage=1&rp=1&ru=/ta/ # coding-interviews&qru=/ta/coding-interviews/question-ranking # write code here | 3.527322 | 4 |
tests/languages/test_bengali.py | kevinbazira/revscoring | 49 | 6630317 | import pickle
from pytest import mark
from revscoring.datasources import revision_oriented
from revscoring.dependencies import solve
from revscoring.languages import bengali
from .util import compare_extraction
BAD = [
"magi",
"মাগী",
"বাল",
"পর্নো",
"পর্ণো",
"বেশ্যা",
"নষ্টা",
"মগা"... | import pickle
from pytest import mark
from revscoring.datasources import revision_oriented
from revscoring.dependencies import solve
from revscoring.languages import bengali
from .util import compare_extraction
BAD = [
"magi",
"মাগী",
"বাল",
"পর্নো",
"পর্ণো",
"বেশ্যা",
"নষ্টা",
"মগা"... | bn | 0.986141 | সত্যজিৎ রায় একজন ভারতীয় চলচ্চিত্র নির্মাতা ও বিংশ শতাব্দীর অন্যতম শ্রেষ্ঠ চলচ্চিত্র পরিচালক। কলকাতা শহরে সাহিত্য ও শিল্পের জগতে খ্যাতনামা এক বাঙালি পরিবারে তাঁর জন্ম হয়। তিনি কলকাতার প্রেসিডেন্সি কলেজ ও শান্তিনিকেতনে রবীন্দ্রনাথ ঠাকুরের প্রতিষ্ঠিত বিশ্বভারতী বিশ্ববিদ্যালয়ে পড়াশোনা করেন। সত্যজিতের ক... | 2.066974 | 2 |
sympy/assumptions/handlers/calculus.py | nashalex/sympy | 8,323 | 6630318 | """
This module contains query handlers responsible for calculus queries:
infinitesimal, finite, etc.
"""
from sympy.assumptions import Q, ask
from sympy.core import Add, Mul, Pow, Symbol
from sympy.core.numbers import (ComplexInfinity, Exp1, GoldenRatio, ImaginaryUnit,
Infinity, NaN, NegativeInfinity, Number, Pi,... | """
This module contains query handlers responsible for calculus queries:
infinitesimal, finite, etc.
"""
from sympy.assumptions import Q, ask
from sympy.core import Add, Mul, Pow, Symbol
from sympy.core.numbers import (ComplexInfinity, Exp1, GoldenRatio, ImaginaryUnit,
Infinity, NaN, NegativeInfinity, Number, Pi,... | en | 0.740584 | This module contains query handlers responsible for calculus queries: infinitesimal, finite, etc. # FinitePredicate # type: ignore Handles Symbol. # type: ignore Return True if expr is bounded, False if not and None if unknown. Truth Table: +-------+-----+-----------+-----------+ | | | ... | 2.396347 | 2 |
CircuitPython_SharpDisplay_Displayio/code.py | albinger/Adafruit_Learning_System_Guides | 0 | 6630319 | <reponame>albinger/Adafruit_Learning_System_Guides<filename>CircuitPython_SharpDisplay_Displayio/code.py<gh_stars>0
# SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries
# SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import random
import time
import adafruit_dis... | # SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries
# SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import random
import time
import adafruit_display_text.label
from adafruit_bitmap_font import bitmap_font
import board
import displayio
import framebufferio
impo... | en | 0.770719 | # SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries # SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT ## When making several changes, this ensures they aren't shown partially ## completed (except for the time to actually update the display) # https://saytheirnames.... | 2.06433 | 2 |
ai_framework/ai_visualization/test_ai_demo.py | Scott-Morgan-Foundation/Highcliff-SDK | 0 | 6630320 | import time
import unittest
from ai_framework.ai_visualization import AIDemo
from ai_framework.ai_actions import ActionStatus
class TestAIDemo(unittest.TestCase):
@classmethod
def setUpClass(cls):
demo_markdown_file_folder = '/Users/jerry/OneDrive/Documents/Obsidian Vault/'
cls._ai_demo = AID... | import time
import unittest
from ai_framework.ai_visualization import AIDemo
from ai_framework.ai_actions import ActionStatus
class TestAIDemo(unittest.TestCase):
@classmethod
def setUpClass(cls):
demo_markdown_file_folder = '/Users/jerry/OneDrive/Documents/Obsidian Vault/'
cls._ai_demo = AID... | en | 0.860858 | # make the first diary entry # make the second diary entry # make the third diary entry | 2.576413 | 3 |
handsdown/processors/rst.py | vemel/handsdown | 47 | 6630321 | <filename>handsdown/processors/rst.py
"""
# reStructuredText Docstring Processor
Docstring processor for restructured text docstring format.
Supported features:
- `:param <name> <?type>: <?description>` directive is added to `Arguments` section
- `:type: <?description>` directive transformed to `Type: <type>`
- `:re... | <filename>handsdown/processors/rst.py
"""
# reStructuredText Docstring Processor
Docstring processor for restructured text docstring format.
Supported features:
- `:param <name> <?type>: <?description>` directive is added to `Arguments` section
- `:type: <?description>` directive transformed to `Type: <type>`
- `:re... | en | 0.763137 | # reStructuredText Docstring Processor Docstring processor for restructured text docstring format. Supported features: - `:param <name> <?type>: <?description>` directive is added to `Arguments` section - `:type: <?description>` directive transformed to `Type: <type>` - `:returns <?type>: <?description>` directive i... | 2.28147 | 2 |
figures/pipeline/loaders.py | groovetch/edx-figures | 43 | 6630322 | <reponame>groovetch/edx-figures
"""
"""
from __future__ import absolute_import
from figures.models import LearnerCourseGradeMetrics
def save_learner_course_grades(site, date_for, course_enrollment, course_progress_details):
"""
``course_progress_details`` data are the ``course_progress_details`` from the
... | """
"""
from __future__ import absolute_import
from figures.models import LearnerCourseGradeMetrics
def save_learner_course_grades(site, date_for, course_enrollment, course_progress_details):
"""
``course_progress_details`` data are the ``course_progress_details`` from the
``LearnerCourseGrades.course_... | en | 0.536191 | ``course_progress_details`` data are the ``course_progress_details`` from the ``LearnerCourseGrades.course_progress method`` # details = course_progress['course_progress_details'] | 2.486479 | 2 |
Classification K-NN/Developing a K-NN (Nearest Neighbors) Classification Model.py | csitedexperts/DSML_MadeEasy | 1 | 6630323 |
# Developing a K-NN (Nearest Neighbors) Classification Model
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('CompSurvey_Product1.csv')
X = dataset.iloc[:, [1, 7]].values
y = dataset.iloc[:, 8].values
# Splitting the dat... |
# Developing a K-NN (Nearest Neighbors) Classification Model
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('CompSurvey_Product1.csv')
X = dataset.iloc[:, [1, 7]].values
y = dataset.iloc[:, 8].values
# Splitting the dat... | en | 0.737028 | # Developing a K-NN (Nearest Neighbors) Classification Model # Importing the libraries # Importing the dataset # Splitting the dataset into the Training set and Test set # Splitting the dataset4 into the Training set and Test set #from sklearn import cross_validation as cv ## cross_validation is deprecated since versio... | 3.4564 | 3 |
huddlebot/settings/production.py | Hipo/huddlebot | 0 | 6630324 | <filename>huddlebot/settings/production.py<gh_stars>0
from huddlebot.settings.base import * # noqa
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
SECRET_KEY = secrets.SECRET_KEY
DEBUG = False
SERVER_URL = "http://huddlebot.hack.hipolabs.com"
ALLOWED_HOSTS = [
'localhost',
'... | <filename>huddlebot/settings/production.py<gh_stars>0
from huddlebot.settings.base import * # noqa
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
SECRET_KEY = secrets.SECRET_KEY
DEBUG = False
SERVER_URL = "http://huddlebot.hack.hipolabs.com"
ALLOWED_HOSTS = [
'localhost',
'... | none | 1 | 1.542613 | 2 | |
load_inputs/cobalt_spin_resolved.py | DanielaZahn/TTM_inputs_from_DFT_results | 1 | 6630325 | import scipy.constants as constants
import numpy as np
import re
# required constants
HARTREE_TO_EV = constants.physical_constants['joule-electron volt relationship'][0]\
/constants.physical_constants['joule-hartree relationship'][0] # conversion factor from Hartree to eV
AVOGADROS_NUMBER = constants.Avogadro # ... | import scipy.constants as constants
import numpy as np
import re
# required constants
HARTREE_TO_EV = constants.physical_constants['joule-electron volt relationship'][0]\
/constants.physical_constants['joule-hartree relationship'][0] # conversion factor from Hartree to eV
AVOGADROS_NUMBER = constants.Avogadro # ... | en | 0.823925 | # required constants # conversion factor from Hartree to eV # particles/mol # material-specific data # read electronic DOS (preferably per unit cell, see unit cell volume) # units here: Hartree, states per Hartree per unit cell (is converted to eV below) # unit cell volume (or, if e_dos and v_dos are not given per unit... | 2.781754 | 3 |
scripts/tests/sample_module/sample3.py | pv/pydocweb | 2 | 6630326 | <filename>scripts/tests/sample_module/sample3.py
func0 = lambda x: x
func0.__name__ = "func0"
class Cls4(object):
func1 = lambda x: x
func1.__name__ = "func1"
func2 = lambda x: x
func2.__name__ = "func2"
| <filename>scripts/tests/sample_module/sample3.py
func0 = lambda x: x
func0.__name__ = "func0"
class Cls4(object):
func1 = lambda x: x
func1.__name__ = "func1"
func2 = lambda x: x
func2.__name__ = "func2"
| none | 1 | 2.026446 | 2 | |
GenomicConsensus/__init__.py | PacificBiosciences/GenomicConsensus | 96 | 6630327 | <reponame>PacificBiosciences/GenomicConsensus
# Author: <NAME>, <NAME>
from __future__ import absolute_import, division, print_function
__VERSION__ = '2.3.3' # don't forget to update setup.py and doc/conf.py too
| # Author: <NAME>, <NAME>
from __future__ import absolute_import, division, print_function
__VERSION__ = '2.3.3' # don't forget to update setup.py and doc/conf.py too | en | 0.915611 | # Author: <NAME>, <NAME> # don't forget to update setup.py and doc/conf.py too | 0.934117 | 1 |
tools/dns-sync/tests/test_audit_log_loop.py | ruchirjain86/professional-services | 2,116 | 6630328 | <filename>tools/dns-sync/tests/test_audit_log_loop.py
# Copyright 2017 Google 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
#
... | <filename>tools/dns-sync/tests/test_audit_log_loop.py
# Copyright 2017 Google 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
#
... | en | 0.853432 | # Copyright 2017 Google 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 by applicable law or agreed to in wr... | 2.205751 | 2 |
listings/chap10/listing_10_4_dummy_variables.py | unixime/fight-churn | 0 | 6630329 | <gh_stars>0
import pandas as pd
from listing_10_3_grouped_category_cohorts import group_category_column
def dummy_variables(data_set_path, groups={},current=False):
raw_data = pd.read_csv(data_set_path, index_col=[0, 1])
for cat in groups.keys():
group_category_column(raw_data,cat,groups[cat])
... | import pandas as pd
from listing_10_3_grouped_category_cohorts import group_category_column
def dummy_variables(data_set_path, groups={},current=False):
raw_data = pd.read_csv(data_set_path, index_col=[0, 1])
for cat in groups.keys():
group_category_column(raw_data,cat,groups[cat])
data_w_dummi... | none | 1 | 2.886543 | 3 | |
tools/dump_bytecode.py | wenq1/duktape | 34 | 6630330 | #!/usr/bin/env python2
#
# Utility to dump bytecode into a human readable form.
#
import os
import sys
import struct
import optparse
def decode_string(buf, off):
strlen, = struct.unpack('>L', buf[off:off+4])
off += 4
strdata = buf[off:off+strlen]
off += strlen
return off, strdata
def sanitize_s... | #!/usr/bin/env python2
#
# Utility to dump bytecode into a human readable form.
#
import os
import sys
import struct
import optparse
def decode_string(buf, off):
strlen, = struct.unpack('>L', buf[off:off+4])
off += 4
strdata = buf[off:off+strlen]
off += strlen
return off, strdata
def sanitize_s... | en | 0.722434 | #!/usr/bin/env python2 # # Utility to dump bytecode into a human readable form. # # Don't try to UTF-8 decode, just escape non-printable ASCII. # Line numbers present, assuming debugger support; otherwise 0. # actually a buffer | 3.089229 | 3 |
image_vision/plugins/mdi/area.py | IvanKosik/ImageVision | 0 | 6630331 | from core import Plugin
from plugins.window import MainWindowPlugin
from extensions.mdi import MdiArea
class MdiAreaPlugin(Plugin):
def __init__(self, main_window_plugin: MainWindowPlugin):
super().__init__()
self.main_window = main_window_plugin.main_window
self.mdi_area = Md... | from core import Plugin
from plugins.window import MainWindowPlugin
from extensions.mdi import MdiArea
class MdiAreaPlugin(Plugin):
def __init__(self, main_window_plugin: MainWindowPlugin):
super().__init__()
self.main_window = main_window_plugin.main_window
self.mdi_area = Md... | none | 1 | 1.783319 | 2 | |
cmds/information.py | hacknorris-aka-penguin/discord-tux | 0 | 6630332 | import discord
from discord.ext import commands
class information(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def neofetch(self, ctx):
await ctx.send(
f"```fix\n /--\ OS NAME : {ctx.guild.name}\n -- \--/ -- \n / \ ST... | import discord
from discord.ext import commands
class information(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def neofetch(self, ctx):
await ctx.send(
f"```fix\n /--\ OS NAME : {ctx.guild.name}\n -- \--/ -- \n / \ ST... | en | 0.22457 | #{member.discriminator}```") | 2.712462 | 3 |
src/hello.py | JunyaKaneko/github-actions-hello-world | 0 | 6630333 | def hello(name):
return 'Hello, {}'.format(name)
| def hello(name):
return 'Hello, {}'.format(name)
| none | 1 | 2.071803 | 2 | |
api/admin.py | razin92/payme | 1 | 6630334 | from django.contrib import admin
from .models import Transaction, BasicAuth
# Register your models here.
admin.site.register(Transaction)
admin.site.register(BasicAuth) | from django.contrib import admin
from .models import Transaction, BasicAuth
# Register your models here.
admin.site.register(Transaction)
admin.site.register(BasicAuth) | en | 0.968259 | # Register your models here. | 1.418075 | 1 |
smt/applications/ego.py | Laurentww/smt | 0 | 6630335 | <gh_stars>0
"""
Authors: <NAME>, <NAME>, <NAME>, <NAME> <<EMAIL>>
This package is distributed under New BSD license.
"""
import numpy as np
from types import FunctionType
from scipy.stats import norm
from scipy.optimize import minimize
from smt.utils.options_dictionary import OptionsDictionary
from smt.applicatio... | """
Authors: <NAME>, <NAME>, <NAME>, <NAME> <<EMAIL>>
This package is distributed under New BSD license.
"""
import numpy as np
from types import FunctionType
from scipy.stats import norm
from scipy.optimize import minimize
from smt.utils.options_dictionary import OptionsDictionary
from smt.applications.applicati... | en | 0.590099 | Authors: <NAME>, <NAME>, <NAME>, <NAME> <<EMAIL>> This package is distributed under New BSD license. An interface for evaluation of a function at x points (nsamples of dimension nx). User can derive this interface and override the run() method to implement custom multiprocessing. Evaluates fun at x. Param... | 2.015591 | 2 |
P3-Capstone/ros/src/twist_controller/twist_controller.py | lucasosouza/udacity-carnd-term3 | 0 | 6630336 | <reponame>lucasosouza/udacity-carnd-term3<filename>P3-Capstone/ros/src/twist_controller/twist_controller.py
import rospy
from yaw_controller import YawController
from pid import PID
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, *args, **kwargs):
# TODO: Implement
... | import rospy
from yaw_controller import YawController
from pid import PID
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, *args, **kwargs):
# TODO: Implement
vehicle_mass = kwargs['vehicle_mass']
fuel_capacity = kwargs['fuel_capacity']
decel_lim... | en | 0.740757 | # TODO: Implement # Calculate required braking torque according to vehicle dynamics? # Use F = ma to calculate the # F_max = m * a_max # T_max = F_max * r = m * r * a_max # Assume all CoFs (Coefficient of Frictions) are 1 # Tune the parameters in dbw_node Reset PID when dbw_enable event is disabled :return: # T... | 2.775981 | 3 |
datahub/search/test/search_support/simplemodel/signals.py | Staberinde/data-hub-api | 6 | 6630337 | <gh_stars>1-10
from django.db.models.signals import post_delete, pre_delete
from datahub.search.signals import SignalReceiver
from datahub.search.test.search_support.models import SimpleModel as DBSimpleModel
def dummy_on_delete_callback(instance):
"""
Function called on_delete and deliberately empty.
It... | from django.db.models.signals import post_delete, pre_delete
from datahub.search.signals import SignalReceiver
from datahub.search.test.search_support.models import SimpleModel as DBSimpleModel
def dummy_on_delete_callback(instance):
"""
Function called on_delete and deliberately empty.
It can be used to... | en | 0.97116 | Function called on_delete and deliberately empty. It can be used to check if/when it's called. | 2.07657 | 2 |
checkov/terraform/checks/resource/aws/IAMRoleAllowAssumeFromAccount.py | people-ai/checkov | 1 | 6630338 | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
import json
import re
class IAMRoleAllowAssumeFromAccount(BaseResourceCheck):
def __init__(self):
name = "Ensure IAM role allows only specific principal... | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
import json
import re
class IAMRoleAllowAssumeFromAccount(BaseResourceCheck):
def __init__(self):
name = "Ensure IAM role allows only specific principal... | none | 1 | 2.163262 | 2 | |
deepscreening/chemvae.py | iwasakishuto/DeepScreening | 8 | 6630339 | <gh_stars>1-10
# coding: utf-8
import os
import re
import argparse
import warnings
import numpy as np
from keras.layers import (Layer, Input, Lambda, Dense, Flatten, RepeatVector,
Dropout, Concatenate, Convolution1D, GRU,
BatchNormalization)
from keras.models import l... | # coding: utf-8
import os
import re
import argparse
import warnings
import numpy as np
from keras.layers import (Layer, Input, Lambda, Dense, Flatten, RepeatVector,
Dropout, Concatenate, Convolution1D, GRU,
BatchNormalization)
from keras.models import load_model, Mode... | en | 0.633429 | # coding: utf-8 # Build the respective models. # Integrates everything. # Memorize. # Add losses. # ============================= # Lambda layer # ============================= reparameterization trick instead of sampling from Q(z|X), sample epsilon = N(0,I) z = z_mean + sqrt(var) * epsilon ~~~ @params ... | 2.246013 | 2 |
tests/test_basic.py | cunni/pyspherepack | 1 | 6630340 | import pytest
from pyspherepack import Box
import numpy as np
# set up a module scoped box so that the test box (and really the pack()) is only instantiated once.
@pytest.fixture(scope="module")
def box_11packed():
b = Box(11,n_iters=50000)
b.pack()
return b
def test_box_instance():
# create Box
b... | import pytest
from pyspherepack import Box
import numpy as np
# set up a module scoped box so that the test box (and really the pack()) is only instantiated once.
@pytest.fixture(scope="module")
def box_11packed():
b = Box(11,n_iters=50000)
b.pack()
return b
def test_box_instance():
# create Box
b... | en | 0.90452 | # set up a module scoped box so that the test box (and really the pack()) is only instantiated once. # create Box # 41 balls # create Box # permissive, just to make sure # permissive, just to make sure | 2.353528 | 2 |
Packs/SentinelOne/Integrations/SentinelOne-V2/SentinelOne-V2.py | cbrake1/content | 1 | 6630341 | <gh_stars>1-10
from typing import Callable
import demistomock as demisto
from CommonServerPython import *
''' IMPORTS '''
import json
import requests
import traceback
from dateutil.parser import parse
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS '''
IS_VERSION_2_1: bool
'... | from typing import Callable
import demistomock as demisto
from CommonServerPython import *
''' IMPORTS '''
import json
import requests
import traceback
from dateutil.parser import parse
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS '''
IS_VERSION_2_1: bool
''' HELPER FUNCT... | en | 0.766639 | IMPORTS # Disable insecure warnings GLOBALS HELPER FUNCTIONS # Only available in 2.0 # Only available in 2.0 # Only available in 2.0 # Only available in 2.0 # Only available in 2.0 # Only available in 2.0 Client will implement the service API, and should not contain any Demisto logic. Should only do requests and re... | 2.16795 | 2 |
src/sentry/incidents/endpoints/organization_alert_rule_trigger_action_details.py | pombredanne/django-sentry | 0 | 6630342 | from __future__ import absolute_import
from rest_framework import status
from rest_framework.response import Response
from sentry.api.serializers import serialize
from sentry.incidents.endpoints.bases import OrganizationAlertRuleTriggerActionEndpoint
from sentry.incidents.endpoints.serializers import AlertRuleTrigger... | from __future__ import absolute_import
from rest_framework import status
from rest_framework.response import Response
from sentry.api.serializers import serialize
from sentry.incidents.endpoints.bases import OrganizationAlertRuleTriggerActionEndpoint
from sentry.incidents.endpoints.serializers import AlertRuleTrigger... | en | 0.946024 | Fetch an alert rule trigger action. ``````````````````````````````````` :auth: required | 2.097556 | 2 |
Authentication.py | Snowbell92/funlearn | 0 | 6630343 | from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QLineEdit, QMessageBox
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
import tkinter as tk
from StartingPage import StartingPage
import mysql.connector
class App(QWidget):
trial = 0
UID = None
username = None
def __init__(... | from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QLineEdit, QMessageBox
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
import tkinter as tk
from StartingPage import StartingPage
import mysql.connector
class App(QWidget):
trial = 0
UID = None
username = None
def __init__(... | en | 0.340878 | root = tk.Tk() self.width = root.winfo_screenwidth() self.height = root.winfo_screenheight() # print(self.width, self.height) # passwd="<PASSWORD>", # elif flag == False: # self.lbl_error.show() # passwd = "<PASSWORD>", # name = self.txt_username.text() # print(name, " ", pwd) # print(myCursor.rowcount,... | 2.732009 | 3 |
example/benchmark/ijson_pubsub/client.py | kokizzu/ijson | 117 | 6630344 | <filename>example/benchmark/ijson_pubsub/client.py<gh_stars>100-1000
import sys
from requests import Session
queue = sys.argv[1] if len(sys.argv) > 1 else '/sum'
s = Session()
while True:
s.post(f'http://localhost:8001' + queue, json={'a': 5, 'b': 8}, headers={'Type': 'pub'})
| <filename>example/benchmark/ijson_pubsub/client.py<gh_stars>100-1000
import sys
from requests import Session
queue = sys.argv[1] if len(sys.argv) > 1 else '/sum'
s = Session()
while True:
s.post(f'http://localhost:8001' + queue, json={'a': 5, 'b': 8}, headers={'Type': 'pub'})
| none | 1 | 2.271245 | 2 | |
bukiyipmodtest.py | NtateLephadi/csc1015f_assignment_4 | 0 | 6630345 | # test program for Bukiyip calculations
import bukiyip
print('**** Bukiyip test program ****')
print('Available commands:')
print('d <number> : convert given decimal number to base-3.')
print('b <number> : convert given base-3 number to decimal.')
print('a <number> <number> : add the given base-3 numbers.')
print('m ... | # test program for Bukiyip calculations
import bukiyip
print('**** Bukiyip test program ****')
print('Available commands:')
print('d <number> : convert given decimal number to base-3.')
print('b <number> : convert given base-3 number to decimal.')
print('a <number> <number> : add the given base-3 numbers.')
print('m ... | en | 0.788313 | # test program for Bukiyip calculations | 4.126408 | 4 |
reduceccd/__init__.py | jselsing/reduceccd | 6 | 6630346 | from .reduceccd import *
| from .reduceccd import *
| none | 1 | 1.028683 | 1 | |
predico/sample/tour/current_request.py | pauleveritt/predico | 0 | 6630347 | from dataclasses import dataclass
from predico import registry
from predico.sample import servicemanager, setup, Article
from predico.services.request.base_request import Request
@registry.view(
resource=Article,
template_string='<h1>{v.name}: {v.request.resource.title}</h1>'
)
@dataclass
class ArticleView:
... | from dataclasses import dataclass
from predico import registry
from predico.sample import servicemanager, setup, Article
from predico.services.request.base_request import Request
@registry.view(
resource=Article,
template_string='<h1>{v.name}: {v.request.resource.title}</h1>'
)
@dataclass
class ArticleView:
... | none | 1 | 2.158318 | 2 | |
pyDMPC/ControlFramework/Inits/Init_Geo.py | RWTH-EBC/pyDMPC | 15 | 6630348 | # Global paths
glob_lib_paths = [r'C:\Git\pyDMPC\pyDMPC\ModelicaModels\ModelicaModels',
r'C:\Git\modelica-buildings\Buildings',
r'C:\Git\AixLib\AixLib']
glob_res_path = r'C:\TEMP\Dymola'
glob_dym_path = r'C:\Program Files\Dymola 2018 FD01\Modelica\Library\python_interface\dymola.egg'
# Workin... | # Global paths
glob_lib_paths = [r'C:\Git\pyDMPC\pyDMPC\ModelicaModels\ModelicaModels',
r'C:\Git\modelica-buildings\Buildings',
r'C:\Git\AixLib\AixLib']
glob_res_path = r'C:\TEMP\Dymola'
glob_dym_path = r'C:\Program Files\Dymola 2018 FD01\Modelica\Library\python_interface\dymola.egg'
# Workin... | en | 0.549123 | # Global paths # Working directory # Controlled system # States # Times # Paths # Modifiers # Variation # Subsystem Config # Subsystems | 1.57012 | 2 |
app/mxcache.py | spacedogXYZ/email-validator | 3 | 6630349 | import flanker.addresslib
from flanker.addresslib.drivers.redis_driver import RedisCache
import redis
import collections
import dnsq
class MxCache(object):
def __init__(self, app=None):
self.app = app
if app is not None:
self.init_app(app)
def init_app(self, app):
if 'REDI... | import flanker.addresslib
from flanker.addresslib.drivers.redis_driver import RedisCache
import redis
import collections
import dnsq
class MxCache(object):
def __init__(self, app=None):
self.app = app
if app is not None:
self.init_app(app)
def init_app(self, app):
if 'REDI... | en | 0.472869 | # cache mail server responses # set custom DNS timeout | 2.471929 | 2 |
tvof/text_search/migrations/0002_auto_20181118_2039.py | kingsdigitallab/tvof-django | 0 | 6630350 | <filename>tvof/text_search/migrations/0002_auto_20181118_2039.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-18 20:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('text_search', '0001_initial'),
]
operations = [
... | <filename>tvof/text_search/migrations/0002_auto_20181118_2039.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-18 20:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('text_search', '0001_initial'),
]
operations = [
... | en | 0.67158 | # -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-11-18 20:39 | 1.634945 | 2 |