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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/handlers/bob/test_rebuild_images_on_image_advisory_change.py | mulaievaRH/freshmaker | 5 | 6633151 | <reponame>mulaievaRH/freshmaker
# Copyright (c) 2019 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, co... | # Copyright (c) 2019 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, dist... | en | 0.77001 | # Copyright (c) 2019 Red Hat, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, dist... | 1.309844 | 1 |
examples/mongo_ormexample.py | abhinavabcd/blaster | 4 | 6633152 | <reponame>abhinavabcd/blaster<gh_stars>1-10
from blaster.common_funcs_and_datastructures import get_random_id, cur_ms
from blaster.config import IS_DEV
from blaster.mongo_orm import Connection, Model, Attribute, init_mongo_cluster
#step 1
class SalesAgent(Model):
_collection_name_ = "domain_agents"
company = Attri... | from blaster.common_funcs_and_datastructures import get_random_id, cur_ms
from blaster.config import IS_DEV
from blaster.mongo_orm import Connection, Model, Attribute, init_mongo_cluster
#step 1
class SalesAgent(Model):
_collection_name_ = "domain_agents"
company = Attribute(str)
agent_user_id = Attribute(str)
a... | en | 0.53642 | #step 1 #call this function after you import all mongo db classes/models #check if connection exists #query single item only #direct mongo query #wont have any #this rreturns a map | 2.423315 | 2 |
qa_testing/unit_tests.py | chrisasa/freetrade-portofolio-screener | 0 | 6633153 | import configparser
import logging
import finnhub
config = configparser.ConfigParser()
config.read('configs/config_sec.ini')
api_key = config['finnhub']['ApiToken']
def TEST_get_stock_price():
stock_symbol = 'AMZN'
rsp = finnhub.get_stock_price(stock_symbol)
logging.info(rsp)
if rsp <= 0 and not... | import configparser
import logging
import finnhub
config = configparser.ConfigParser()
config.read('configs/config_sec.ini')
api_key = config['finnhub']['ApiToken']
def TEST_get_stock_price():
stock_symbol = 'AMZN'
rsp = finnhub.get_stock_price(stock_symbol)
logging.info(rsp)
if rsp <= 0 and not... | en | 0.407636 | # logging_format = "%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s" # logging_format = "%(asctime)s %(levelname)-8s [%(filename)s:%(lineno)d] %(name)s | %(message)s" # logging.basicConfig(handlers=[logging.FileHandler(all_logs_file_path),logging.StreamHandler()], format=logging_format, leve... | 2.53853 | 3 |
scripts/parse_ip.py | taojian2009/riverboat | 0 | 6633154 | <reponame>taojian2009/riverboat
import pandas as pd
from server.utils import parse_location
from config import Config
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from server.model import RequestLog
def get_engine():
engine = create_engine(Config.SQLALCHEMY_DATABASE_URI)
retu... | import pandas as pd
from server.utils import parse_location
from config import Config
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from server.model import RequestLog
def get_engine():
engine = create_engine(Config.SQLALCHEMY_DATABASE_URI)
return engine
def get_session():
... | en | 0.240716 | update request_log set {snippet} where remote_addr="{ip}"; | 2.594342 | 3 |
test/analytics/test_gitlab_ci.py | aexvir/the-zoo | 90 | 6633155 | <gh_stars>10-100
import yaml
from zoo.analytics.tasks import gitlab_ci as uut
YAML = """\
stages:
- build
- test
- release
- deploy
image: docker:19.03
include:
- 'https://ci-files.skypicker.com/templates/build/coala.yml'
- 'https://ci-files.skypicker.com/templates/build/black.yml'
- 'https://ci-files... | import yaml
from zoo.analytics.tasks import gitlab_ci as uut
YAML = """\
stages:
- build
- test
- release
- deploy
image: docker:19.03
include:
- 'https://ci-files.skypicker.com/templates/build/coala.yml'
- 'https://ci-files.skypicker.com/templates/build/black.yml'
- 'https://ci-files.skypicker.com/te... | en | 0.546559 | \ stages: - build - test - release - deploy image: docker:19.03 include: - 'https://ci-files.skypicker.com/templates/build/coala.yml' - 'https://ci-files.skypicker.com/templates/build/black.yml' - 'https://ci-files.skypicker.com/templates/build/docker_build.yml' - 'https://ci-files.skypicker.com/templ... | 2.039386 | 2 |
hierarchyapp/apps.py | KA-Randy-Charity-Jr/hierarchial_data | 0 | 6633156 | <filename>hierarchyapp/apps.py
from django.apps import AppConfig
class HierarchyappConfig(AppConfig):
name = 'hierarchyapp'
| <filename>hierarchyapp/apps.py
from django.apps import AppConfig
class HierarchyappConfig(AppConfig):
name = 'hierarchyapp'
| none | 1 | 1.250817 | 1 | |
acculturation/datareaders.py | romankoval/comp-acculturation | 9 | 6633157 |
import os
import csv
import json
import re
try:
import mailparser
except:
print("Warning: failed to load mail-parser module. This will be an issue if you want to process .eml files.")
try:
import unidecode
except:
print("Warning: failed to load unidecode module. This will be an issue if you want to p... |
import os
import csv
import json
import re
try:
import mailparser
except:
print("Warning: failed to load mail-parser module. This will be an issue if you want to process .eml files.")
try:
import unidecode
except:
print("Warning: failed to load unidecode module. This will be an issue if you want to p... | en | 0.797186 | ########################################### Search dir and subdirs for all files with given extension # Input is a filename not a dir ########################################### ########################################### Expectation for these files is that each individual line in the file is a json-serialized... | 2.860242 | 3 |
deta/service.py | LemonPi314/deta-python | 0 | 6633158 | <reponame>LemonPi314/deta-python
import http.client
import os
import json
import socket
import struct
import typing
import urllib.error
JSON_MIME = "application/json"
class _Service:
def __init__(
self,
project_key: str,
project_id: str,
host: str,
name: str,
timeo... | import http.client
import os
import json
import socket
import struct
import typing
import urllib.error
JSON_MIME = "application/json"
class _Service:
def __init__(
self,
project_key: str,
project_id: str,
host: str,
name: str,
timeout: int,
keep_alive: bool... | en | 0.884008 | # 8 = CLOSE_WAIT # close connection if socket is closed # fix for a bug in lambda # send request # response # need to read the response so subsequent requests can be sent on the client # return None if not found # if stream return the response and client without reading and closing the client # return json if applicati... | 2.344564 | 2 |
run.py | W1Fl/- | 2 | 6633159 | <reponame>W1Fl/-
from PIL import Image
import os
import codec
import numpy as np
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
imgurl=os.path.join('test',input('请输入目标图片的编号--> ')+'.png')
img=Image.open(imgurl)
import work
sc=work.comput(np.array(img))[0][0]
print('分析器认为原图有{}%的概率被隐写过'.format(sc*100))
stgimg=codec.encodeDataInI... | from PIL import Image
import os
import codec
import numpy as np
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
imgurl=os.path.join('test',input('请输入目标图片的编号--> ')+'.png')
img=Image.open(imgurl)
import work
sc=work.comput(np.array(img))[0][0]
print('分析器认为原图有{}%的概率被隐写过'.format(sc*100))
stgimg=codec.encodeDataInImage(img,input('请... | none | 1 | 2.186587 | 2 | |
model/wordrep.py | cslydia/BiFlaG | 59 | 6633160 | <filename>model/wordrep.py
from __future__ import print_function
from __future__ import absolute_import
import torch
import torch.nn as nn
import numpy as np
from .charcnn import IntNet
class WordRep(nn.Module):
def __init__(self, data):
super(WordRep, self).__init__()
print("build word representat... | <filename>model/wordrep.py
from __future__ import print_function
from __future__ import absolute_import
import torch
import torch.nn as nn
import numpy as np
from .charcnn import IntNet
class WordRep(nn.Module):
def __init__(self, data):
super(WordRep, self).__init__()
print("build word representat... | en | 0.567349 | input: word_inputs: (batch_size, sent_len) features: list [(batch_size, sent_len), (batch_len, sent_len),...] word_seq_lengths: list of batch_size, (batch_size,1) char_inputs: (batch_size*sent_len, word_length) char_seq_lengths: list of who... | 2.722334 | 3 |
bambi/backends/pymc.py | OriolAbril/bambi | 0 | 6633161 | import logging
import numpy as np
import theano
import pymc3 as pm
from bambi.priors import Prior
import bambi.version as version
from .base import BackEnd
_log = logging.getLogger("bambi")
class PyMC3BackEnd(BackEnd):
"""PyMC3 model-fitting backend."""
# Available link functions
links = {
"id... | import logging
import numpy as np
import theano
import pymc3 as pm
from bambi.priors import Prior
import bambi.version as version
from .base import BackEnd
_log = logging.getLogger("bambi")
class PyMC3BackEnd(BackEnd):
"""PyMC3 model-fitting backend."""
# Available link functions
links = {
"id... | en | 0.720796 | PyMC3 model-fitting backend. # Available link functions # Attributes defined elsewhere # build() # build() # build() # build() # Inspect all args in case we have hyperparameters Build and return a PyMC3 Distribution. # Non-centered parameterization for hyperpriors # pylint: disable=arguments-differ Compile the PyMC3 mo... | 2.115276 | 2 |
tests/functional/gtcs/test_dsql_domain_06.py | reevespaul/firebird-qa | 0 | 6633162 | <gh_stars>0
#coding:utf-8
#
# id: functional.gtcs.dsql_domain_06
# title: GTCS/tests/DSQL_DOMAIN_06. Test the level 0 syntax for SQL "CREATE DOMAIN" statement using datatype and CHECK constraint clause.
# decription:
# Original test see in:
# https://github.com/F... | #coding:utf-8
#
# id: functional.gtcs.dsql_domain_06
# title: GTCS/tests/DSQL_DOMAIN_06. Test the level 0 syntax for SQL "CREATE DOMAIN" statement using datatype and CHECK constraint clause.
# decription:
# Original test see in:
# https://github.com/FirebirdSQL/f... | en | 0.153244 | #coding:utf-8 # # id: functional.gtcs.dsql_domain_06 # title: GTCS/tests/DSQL_DOMAIN_06. Test the level 0 syntax for SQL "CREATE DOMAIN" statement using datatype and CHECK constraint clause. # decription: # Original test see in: # https://github.com/FirebirdSQL/fbtc... | 1.812957 | 2 |
closed/NVIDIA/code/main.py | EldritchJS/inference_results_v0.5 | 0 | 6633163 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | en | 0.846398 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 1.807481 | 2 |
utils/place.py | rwaldron/pcbmode | 0 | 6633164 | #!/usr/bin/python
from lxml import etree as et
import config
import messages as msg
# pcbmode modules
import utils
import svg
from point import Point
def placeShape(shape, svg_layer, invert=False, original=False):
"""
Places a shape or type 'Shape' onto SVG layer 'svg_layer'.
'invert' : placed path... | #!/usr/bin/python
from lxml import etree as et
import config
import messages as msg
# pcbmode modules
import utils
import svg
from point import Point
def placeShape(shape, svg_layer, invert=False, original=False):
"""
Places a shape or type 'Shape' onto SVG layer 'svg_layer'.
'invert' : placed path... | en | 0.583149 | #!/usr/bin/python # pcbmode modules Places a shape or type 'Shape' onto SVG layer 'svg_layer'. 'invert' : placed path should be mirrored 'original': use the original path, not the transformed one # Set style string # Set style type in pcbmode namespace. This is later used to easliy # identify the type when the... | 2.889535 | 3 |
Homework3/json_parser.py | emilyblack95/CS-5513 | 1 | 6633165 | <filename>Homework3/json_parser.py
import json
counter = 0
page = open('movieData.json', 'r')
parsed = json.loads(page.read())
f = open('dataInsertion.js', 'w+')
f.write('db.createCollection("movies");\n')
f.write('db.movies.ensureIndex("movie_id");\n')
for item in parsed['my_movies']:
if counter<5:... | <filename>Homework3/json_parser.py
import json
counter = 0
page = open('movieData.json', 'r')
parsed = json.loads(page.read())
f = open('dataInsertion.js', 'w+')
f.write('db.createCollection("movies");\n')
f.write('db.movies.ensureIndex("movie_id");\n')
for item in parsed['my_movies']:
if counter<5:... | none | 1 | 3.143598 | 3 | |
graphOfStretchingResistanceConstant.py | Peeks1/AffineCarpetProject | 0 | 6633166 | <gh_stars>0
import matplotlib.pyplot as plt
import os.path as p
import os
# INPUT HERE
# what level affine carpet would you like rhos for:
precarpet_level = 6
# how large would you like the small squares to be:
sideOfSmallSquares = 1 / 4
# would you like a cross or X-graph (input "+" or "x"):
kindOfGraph = "x"
# what... | import matplotlib.pyplot as plt
import os.path as p
import os
# INPUT HERE
# what level affine carpet would you like rhos for:
precarpet_level = 6
# how large would you like the small squares to be:
sideOfSmallSquares = 1 / 4
# would you like a cross or X-graph (input "+" or "x"):
kindOfGraph = "x"
# what stretches w... | en | 0.885056 | # INPUT HERE # what level affine carpet would you like rhos for: # how large would you like the small squares to be: # would you like a cross or X-graph (input "+" or "x"): # what stretches would you like to compute # other important variable calculated from above variables # file naming variables # extract base resis... | 2.773698 | 3 |
server/lib/python/cartodb_services/test/credentials.py | CartoDB/dataservices-api | 22 | 6633167 | import os
def mapbox_api_key():
"""Returns Mapbox API key. Requires setting MAPBOX_API_KEY environment variable."""
return os.environ['MAPBOX_API_KEY']
def tomtom_api_key():
"""Returns TomTom API key. Requires setting TOMTOM_API_KEY environment variable."""
return os.environ['TOMTOM_API_KEY']
def ... | import os
def mapbox_api_key():
"""Returns Mapbox API key. Requires setting MAPBOX_API_KEY environment variable."""
return os.environ['MAPBOX_API_KEY']
def tomtom_api_key():
"""Returns TomTom API key. Requires setting TOMTOM_API_KEY environment variable."""
return os.environ['TOMTOM_API_KEY']
def ... | en | 0.49495 | Returns Mapbox API key. Requires setting MAPBOX_API_KEY environment variable. Returns TomTom API key. Requires setting TOMTOM_API_KEY environment variable. Returns Geocodio API key. Requires setting GEOCODIO_API_KEY environment variable. | 1.836155 | 2 |
dc09_spt/msg/dc05_msg.py | panos-stavrianos/dc09_spt | 19 | 6633168 | <filename>dc09_spt/msg/dc05_msg.py
# ----------------------------
# Class to implement the SIA DC05 message
# (c 2018 van Ovost Automatisering b.v.
# Author : <NAME>
# ----------------------------
from dc09_spt.param import *
"""
Copyright (c) 2018 van Ovost Automatisering b.v.
Licensed under the Apache License, Ver... | <filename>dc09_spt/msg/dc05_msg.py
# ----------------------------
# Class to implement the SIA DC05 message
# (c 2018 van Ovost Automatisering b.v.
# Author : <NAME>
# ----------------------------
from dc09_spt.param import *
"""
Copyright (c) 2018 van Ovost Automatisering b.v.
Licensed under the Apache License, Ver... | en | 0.853544 | # ---------------------------- # Class to implement the SIA DC05 message # (c 2018 van Ovost Automatisering b.v. # Author : <NAME> # ---------------------------- Copyright (c) 2018 van Ovost Automatisering b.v. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complia... | 2.06406 | 2 |
5_kicom_ml/kicomav-master/Engine/plugins/extract.py | Kimchangheon/malware_ML | 4 | 6633169 | <reponame>Kimchangheon/malware_ML<filename>5_kicom_ml/kicomav-master/Engine/plugins/extract.py
# pip install pefile
# pip install yara
# find / -name libyara.so
# cp LIB_YARA_PATH /home/stud/anaconda2/envs/ml_sec_2.7/lib/
import csv,os,pefile
import yara
import math
import hashlib
class PE_features():
IMAGE_DOS... | # pip install pefile
# pip install yara
# find / -name libyara.so
# cp LIB_YARA_PATH /home/stud/anaconda2/envs/ml_sec_2.7/lib/
import csv,os,pefile
import yara
import math
import hashlib
class PE_features():
IMAGE_DOS_HEADER = [
"e_cblp",\
"e_cp", \
... | en | 0.701808 | # pip install pefile # pip install yara # find / -name libyara.so # cp LIB_YARA_PATH /home/stud/anaconda2/envs/ml_sec_2.7/lib/ # boolean check for zero or not This is boolean function and will return 0 or 1 based on condidtions that it SectionAlignment must be greater than or equal to FileAlignment #Check the I... | 2.114234 | 2 |
tests/ast/nodes/test_evaluate_binop_decimal.py | ryan-rozario/vyper | 0 | 6633170 | <reponame>ryan-rozario/vyper
from decimal import (
Decimal,
)
from hypothesis import (
example,
given,
settings,
strategies as st,
)
import pytest
from vyper import (
ast as vy_ast,
)
from vyper.exceptions import (
TypeMismatch,
ZeroDivisionException,
)
st_decimals = st.decimals(
... | from decimal import (
Decimal,
)
from hypothesis import (
example,
given,
settings,
strategies as st,
)
import pytest
from vyper import (
ast as vy_ast,
)
from vyper.exceptions import (
TypeMismatch,
ZeroDivisionException,
)
st_decimals = st.decimals(
min_value=-2 ** 32,
max_v... | en | 0.581701 | @public def foo(a: decimal, b: decimal) -> decimal: return a {op} b # raises because Vyper does not support decimal exponentiation @public def foo({input_value}) -> decimal: return {return_value} # for division/modulus by 0, expect the contract call to revert | 2.480257 | 2 |
Chapter03/Activities/Activity_09.py | talendteams/Data-Science-with-Python | 28 | 6633171 | <filename>Chapter03/Activities/Activity_09.py<gh_stars>10-100
# Activity 5: Generating predictions and evaluating performance of decision tree classifier model
# continuing from Exercise 11:
# generate predicted probabilities of rain
predicted_prob = model.predict_proba(X_test_scaled)[:,1]
# generate predicted class... | <filename>Chapter03/Activities/Activity_09.py<gh_stars>10-100
# Activity 5: Generating predictions and evaluating performance of decision tree classifier model
# continuing from Exercise 11:
# generate predicted probabilities of rain
predicted_prob = model.predict_proba(X_test_scaled)[:,1]
# generate predicted class... | en | 0.77916 | # Activity 5: Generating predictions and evaluating performance of decision tree classifier model # continuing from Exercise 11: # generate predicted probabilities of rain # generate predicted classes # evaluate performance with confusion matrix # generate a classification report | 3.439009 | 3 |
MelodyHouse/upload_app/urls.py | Koushik-Sarker-Seemanto/Project-350 | 6 | 6633172 | <reponame>Koushik-Sarker-Seemanto/Project-350
from django.conf.urls import url
from django.urls import path, include
from . import views
app_name = 'upload_app'
urlpatterns = [
# url(r'^signup/$', views.signupView, name='signup'),
path('upload/', views.addAlbum, name='add-album'),
]
| from django.conf.urls import url
from django.urls import path, include
from . import views
app_name = 'upload_app'
urlpatterns = [
# url(r'^signup/$', views.signupView, name='signup'),
path('upload/', views.addAlbum, name='add-album'),
] | en | 0.359628 | # url(r'^signup/$', views.signupView, name='signup'), | 1.656607 | 2 |
mlonmcu/models/options.py | tum-ei-eda/mlonmcu | 3 | 6633173 | <gh_stars>1-10
#
# Copyright (c) 2022 TUM Department of Electrical and Computer Engineering.
#
# This file is part of MLonMCU.
# See https://github.com/tum-ei-eda/mlonmcu.git for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | #
# Copyright (c) 2022 TUM Department of Electrical and Computer Engineering.
#
# This file is part of MLonMCU.
# See https://github.com/tum-ei-eda/mlonmcu.git for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | en | 0.861011 | # # Copyright (c) 2022 TUM Department of Electrical and Computer Engineering. # # This file is part of MLonMCU. # See https://github.com/tum-ei-eda/mlonmcu.git for further info. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m... | 1.943375 | 2 |
userprofile/admin.py | FiniteElementries/barebone_server | 0 | 6633174 | <reponame>FiniteElementries/barebone_server
from django.contrib import admin
from userprofile.models import UserProfile
# Register your models here.
admin.site.register(UserProfile) | from django.contrib import admin
from userprofile.models import UserProfile
# Register your models here.
admin.site.register(UserProfile) | en | 0.968259 | # Register your models here. | 1.381042 | 1 |
jetbot/__init__.py | sibnick/jetbot | 29 | 6633175 | <gh_stars>10-100
from .camera import Camera
from .heartbeat import Heartbeat
from .motor import Motor
from .robot import Robot
from .image import bgr8_to_jpeg
from .object_detection import ObjectDetector
from .ads1115 import ADS1115
from .ina219 import INA219 | from .camera import Camera
from .heartbeat import Heartbeat
from .motor import Motor
from .robot import Robot
from .image import bgr8_to_jpeg
from .object_detection import ObjectDetector
from .ads1115 import ADS1115
from .ina219 import INA219 | none | 1 | 0.95916 | 1 | |
Codes/Mathematical/large_number_gcd.py | datta-agni/Python-Codes | 0 | 6633176 | <reponame>datta-agni/Python-Codes
# program to find GCD of two numbers such that the second number can be very large
# function to find gcd of two integer numbers
def gcd(a, b):
if a == 0:
return b
return gcd(b % a, a)
# Here 'a' is integer and 'b' is string. The idea is to make the second number (... | # program to find GCD of two numbers such that the second number can be very large
# function to find gcd of two integer numbers
def gcd(a, b):
if a == 0:
return b
return gcd(b % a, a)
# Here 'a' is integer and 'b' is string. The idea is to make the second number (represented as b) less than and eq... | en | 0.938807 | # program to find GCD of two numbers such that the second number can be very large # function to find gcd of two integer numbers # Here 'a' is integer and 'b' is string. The idea is to make the second number (represented as b) less than and equal to first number by calculating its mod with first integer number using ba... | 4.163556 | 4 |
wealthbot/chat/views.py | jliev/wealthbot_chatterbot | 1 | 6633177 | # chat/views.py
from django.shortcuts import render
from django.utils.safestring import mark_safe
import json
from datetime import datetime
from django.http import HttpResponse, Http404
from django.contrib.auth.decorators import login_required
from client.forms import PortfolioForm
from client.models import ClientAccou... | # chat/views.py
from django.shortcuts import render
from django.utils.safestring import mark_safe
import json
from datetime import datetime
from django.http import HttpResponse, Http404
from django.contrib.auth.decorators import login_required
from client.forms import PortfolioForm
from client.models import ClientAccou... | en | 0.727203 | # chat/views.py # Get the user object # Get client's portfolio # If client has final portfolio # Skip implementing workflow at this moment # Skip document at this moment | 1.853194 | 2 |
src/crystal_analysis/detection.py | malramsay64/Crystal_Melting | 0 | 6633178 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 <NAME> <<EMAIL>>
#
# Distributed under terms of the MIT license.
"""Utilities for handling the trimer molecule."""
import logging
from itertools import product
from pathlib import Path
from typing import List, NamedTuple, Optional
i... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 <NAME> <<EMAIL>>
#
# Distributed under terms of the MIT license.
"""Utilities for handling the trimer molecule."""
import logging
from itertools import product
from pathlib import Path
from typing import List, NamedTuple, Optional
i... | en | 0.763053 | #! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2018 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. Utilities for handling the trimer molecule. Classify molecules as crystalline, amorphous or boundary. # This gets the details of the box from the simulation # All axes ha... | 2.208899 | 2 |
src/accounts/signals.py | m3h-D/Myinfoblog | 0 | 6633179 | from django.dispatch import receiver, Signal
from django.db.models.signals import post_save
from django.contrib.auth import get_user_model
from .models import Profile
User = get_user_model()
@receiver(post_save, sender=User)
def create_profile(sender, instance, created, *args, **kwargs):
if created:
Pro... | from django.dispatch import receiver, Signal
from django.db.models.signals import post_save
from django.contrib.auth import get_user_model
from .models import Profile
User = get_user_model()
@receiver(post_save, sender=User)
def create_profile(sender, instance, created, *args, **kwargs):
if created:
Pro... | none | 1 | 2.245994 | 2 | |
serminer/src/gen_aging_stressmark_riscv.py | karthiksv/eraser | 0 | 6633180 | <reponame>karthiksv/eraser
# Copyright 2020 IBM Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | # Copyright 2020 IBM Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | en | 0.586025 | # Copyright 2020 IBM Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so... | 1.734188 | 2 |
bot/replies/thanks.py | shivakumarb3/vardhamanbot | 9 | 6633181 | import random
def reply(activity, bot, data):
responses = [
"I'm glad I'm helpful!",
"You're welcome!",
"I'm glad I could be of assistance",
"Your're very welcome!",
"glad to help",
"It's my pleasure",
"Sure thing!",
"I'm touched"
]
response ... | import random
def reply(activity, bot, data):
responses = [
"I'm glad I'm helpful!",
"You're welcome!",
"I'm glad I could be of assistance",
"Your're very welcome!",
"glad to help",
"It's my pleasure",
"Sure thing!",
"I'm touched"
]
response ... | none | 1 | 2.405585 | 2 | |
factories/debian.py | expanse-project/expanse-buildbot | 0 | 6633182 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import factory
reload(factory)
from factory import *
import go_ethereum
reload(go_ethereum)
from go_ethereum import _go_cmds
@properties.renderer
def jsonrpc_for_develop(props):
if 'version' in props:
return int(props['version'][2:3]) > 3
retu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import factory
reload(factory)
from factory import *
import go_ethereum
reload(go_ethereum)
from go_ethereum import _go_cmds
@properties.renderer
def jsonrpc_for_develop(props):
if 'version' in props:
return int(props['version'][2:3]) > 3
return None
@pr... | en | 0.503376 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Set snapshot property for Launchpad versioning # Run 'go get' for go-expanse # clean up the Git checkout for debuild # Get qtwebengine-opensource-src tarball # clean up the Git checkout for debuild # Just create the source tarball for others # Get debian/ directory # Bump... | 1.938096 | 2 |
TASK-8/question 1.py | neha865/Cognizance | 0 | 6633183 | <filename>TASK-8/question 1.py
import numpy as np
a = np.array([10,11,12,13,14])
nz = 5
Z0 = np.zeros(len(a) + (len(a)-1)*(nz))
Z0[::nz+1] = a
print(np.floor(Z0))
| <filename>TASK-8/question 1.py
import numpy as np
a = np.array([10,11,12,13,14])
nz = 5
Z0 = np.zeros(len(a) + (len(a)-1)*(nz))
Z0[::nz+1] = a
print(np.floor(Z0))
| none | 1 | 3.379657 | 3 | |
dataPipelines/gc_neo4j_publisher/neo4j_publisher.py | Wildertrek/gamechanger-data | 18 | 6633184 | <filename>dataPipelines/gc_neo4j_publisher/neo4j_publisher.py
import json
import os
import time
import typing as t
import sys
from pathlib import Path
import pandas as pd
from joblib._multiprocessing_helpers import mp
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor
from gamechangerml.src.featu... | <filename>dataPipelines/gc_neo4j_publisher/neo4j_publisher.py
import json
import os
import time
import typing as t
import sys
from pathlib import Path
import pandas as pd
from joblib._multiprocessing_helpers import mp
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor
from gamechangerml.src.featu... | en | 0.827355 | # # TODO responsibilities # text = j["text"] # self.process_responsibilities(text) # TODO paragraphs # self.process_paragraphs(j, doc_id) # TODO: refactor param injection logic for cypher statements to guarantee valid statements for all valid strings Normalize string to something that won't interfere with a cypher quer... | 2.11961 | 2 |
tinytag/tests/test_all.py | idotobi/tinytag | 0 | 6633185 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# tests can be extended using other bigger files that are not going to be
# checked into git, by placing them into the custom_samples folder
#
# see custom_samples/instructions.txt
#
from __future__ import unicode_literals
import io
import os
import shutil
import sys
import... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# tests can be extended using other bigger files that are not going to be
# checked into git, by placing them into the custom_samples folder
#
# see custom_samples/instructions.txt
#
from __future__ import unicode_literals
import io
import os
import shutil
import sys
import... | en | 0.880599 | #!/usr/bin/python # -*- coding: utf-8 -*- # tests can be extended using other bigger files that are not going to be # checked into git, by placing them into the custom_samples folder # # see custom_samples/instructions.txt # # python 2.6 and 3.2 compat # MP3 # the output of the lame encoder was 185.4 bitrate, but this ... | 2.030362 | 2 |
glue/viewers/scatter/qt/layer_style_editor.py | sergiopasra/glue | 0 | 6633186 | from __future__ import absolute_import, division, print_function
import os
import numpy as np
from qtpy import QtWidgets, QtGui
from qtpy.QtCore import Qt
from glue.external.echo.qt import autoconnect_callbacks_to_qt, connect_value
from glue.utils.qt import load_ui, fix_tab_widget_fontsize
class ScatterLayerStyle... | from __future__ import absolute_import, division, print_function
import os
import numpy as np
from qtpy import QtWidgets, QtGui
from qtpy.QtCore import Qt
from glue.external.echo.qt import autoconnect_callbacks_to_qt, connect_value
from glue.utils.qt import load_ui, fix_tab_widget_fontsize
class ScatterLayerStyle... | none | 1 | 1.959808 | 2 | |
Question7.py | Schrodinger73/PracticalJournal_Class11 | 0 | 6633187 | # Question:-
# WAP to generate 6 random numbers between 100 and 999 and then print their mean, median and mode
# CODE:-
# For this one, we gotta import random module (it is used to generate random numbers).
# Also added the statistics module for finding mean , median and mode
import random
import statistics
# Now, ... | # Question:-
# WAP to generate 6 random numbers between 100 and 999 and then print their mean, median and mode
# CODE:-
# For this one, we gotta import random module (it is used to generate random numbers).
# Also added the statistics module for finding mean , median and mode
import random
import statistics
# Now, ... | en | 0.935615 | # Question:- # WAP to generate 6 random numbers between 100 and 999 and then print their mean, median and mode # CODE:- # For this one, we gotta import random module (it is used to generate random numbers). # Also added the statistics module for finding mean , median and mode # Now, we will put our range in a variable ... | 4.343805 | 4 |
couchdb_upgrade.py | pietervogelaar/couchdb_upgrade | 3 | 6633188 | <reponame>pietervogelaar/couchdb_upgrade
#!/usr/bin/env python
# couchdb_upgrade.py
# https://github.com/pietervogelaar/couchdb_upgrade
#
# Performs a rolling upgrade of a CouchDB cluster
#
# Installing dependencies:
# pip install requests
#
# MIT License
#
# Copyright (c) 2017 <NAME>
#
# Permission is hereby granted,... | #!/usr/bin/env python
# couchdb_upgrade.py
# https://github.com/pietervogelaar/couchdb_upgrade
#
# Performs a rolling upgrade of a CouchDB cluster
#
# Installing dependencies:
# pip install requests
#
# MIT License
#
# Copyright (c) 2017 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining ... | en | 0.678701 | #!/usr/bin/env python # couchdb_upgrade.py # https://github.com/pietervogelaar/couchdb_upgrade # # Performs a rolling upgrade of a CouchDB cluster # # Installing dependencies: # pip install requests # # MIT License # # Copyright (c) 2017 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a... | 2.207471 | 2 |
startup/98-ramp.py | MikeHart85/IOS_profile_collection | 0 | 6633189 | <gh_stars>0
# this is already done in nslsii.configure_base but being explicit here
import bluesky.plans as bp
import bluesky.plan_stubs as bps
import bluesky.preprocessors as bpp
from collections import ChainMap
from ophyd import StatusBase
import time
#from bluesky.spec_api import inner_spec_decorator, setup_plot, s... | # this is already done in nslsii.configure_base but being explicit here
import bluesky.plans as bp
import bluesky.plan_stubs as bps
import bluesky.preprocessors as bpp
from collections import ChainMap
from ophyd import StatusBase
import time
#from bluesky.spec_api import inner_spec_decorator, setup_plot, setup_livetab... | en | 0.802668 | # this is already done in nslsii.configure_base but being explicit here #from bluesky.spec_api import inner_spec_decorator, setup_plot, setup_livetable, _figure_name #This is no longer supported. Define a LivePlot callback or use best effort callback #def setup_norm_plot(*, motors, gs): # """Setup a LivePlot by insp... | 2.172428 | 2 |
installer.py | cartologic/cartoview_geo_observation | 3 | 6633190 | <filename>installer.py
# -*- coding: utf-8 -*-
__author__ = "cartologic"
info = {
"title": "GeoObservation",
"description": """Users can submit new reports, review existing reports, and comment and vote on reports or observations submitted by other users. They can track the status of problems or observations t... | <filename>installer.py
# -*- coding: utf-8 -*-
__author__ = "cartologic"
info = {
"title": "GeoObservation",
"description": """Users can submit new reports, review existing reports, and comment and vote on reports or observations submitted by other users. They can track the status of problems or observations t... | en | 0.933465 | # -*- coding: utf-8 -*- Users can submit new reports, review existing reports, and comment and vote on reports or observations submitted by other users. They can track the status of problems or observations they have reported. Field observations and mobile data collection, whether by professional monitoring staff or b... | 2.256048 | 2 |
model-optimizer/extensions/front/tf/softplus_ext.py | monroid/openvino | 2,406 | 6633191 | <reponame>monroid/openvino
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from mo.front.extractor import FrontExtractorOp
from extensions.ops.activation_ops import SoftPlus
class SoftPlusExtractor(FrontExtractorOp):
op = 'Softplus'
enabled = True
@classmethod
def e... | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from mo.front.extractor import FrontExtractorOp
from extensions.ops.activation_ops import SoftPlus
class SoftPlusExtractor(FrontExtractorOp):
op = 'Softplus'
enabled = True
@classmethod
def extract(cls, node):
... | de | 0.248959 | # Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 | 1.70479 | 2 |
run_saccader103.py | PopGalacticHistory/imagewalker | 2 | 6633192 |
#from image_env_mnist1 import Image_env1
from RL_saccader_x1 import DeepQNetwork
from RL_networks import Stand_alone_net
import numpy as np
import time
import pickle
import copy
import SYCLOP_env as syc
from misc import *
import sys
import os
import tensorflow as tf
import cv2
# cv2.ocl.setUseOpenCL(True... |
#from image_env_mnist1 import Image_env1
from RL_saccader_x1 import DeepQNetwork
from RL_networks import Stand_alone_net
import numpy as np
import time
import pickle
import copy
import SYCLOP_env as syc
from misc import *
import sys
import os
import tensorflow as tf
import cv2
# cv2.ocl.setUseOpenCL(True... | en | 0.277044 | #from image_env_mnist1 import Image_env1 # cv2.ocl.setUseOpenCL(True) # if not os.path.exists(hp.this_run_path): # os.makedirs(hp.this_run_path) # else: # error('run name already exists!') # hp.description = "only 2nd image from videos 1st frame, penalty for speed, soft q learning" # 'saved_runs/run_syclop_gene... | 2.075562 | 2 |
django_pg/models/fields/__init__.py | OlgaBorisova/django-pgfields | 1 | 6633193 | from __future__ import absolute_import, unicode_literals
from django_pg.models.fields.array import ArrayField
from django_pg.models.fields.composite import CompositeField
from django_pg.models.fields.datetime_ import DateTimeField
from django_pg.models.fields.json import JSONField
from django_pg.models.fields.uuid impo... | from __future__ import absolute_import, unicode_literals
from django_pg.models.fields.array import ArrayField
from django_pg.models.fields.composite import CompositeField
from django_pg.models.fields.datetime_ import DateTimeField
from django_pg.models.fields.json import JSONField
from django_pg.models.fields.uuid impo... | none | 1 | 1.243742 | 1 | |
aio_pika/robust_connection.py | nhumrich/aio-pika | 0 | 6633194 | <reponame>nhumrich/aio-pika
import asyncio
from functools import wraps
from logging import getLogger
from typing import Callable, Type
from weakref import WeakSet
from aiormq.connection import parse_bool, parse_int
from .connection import Connection, ConnectionType, connect
from .exceptions import CONNECTION_EXCEPTIO... | import asyncio
from functools import wraps
from logging import getLogger
from typing import Callable, Type
from weakref import WeakSet
from aiormq.connection import parse_bool, parse_int
from .connection import Connection, ConnectionType, connect
from .exceptions import CONNECTION_EXCEPTIONS
from .robust_channel impo... | en | 0.67387 | Robust connection Add callback which will be called after reconnect. :return: None # Store connect kwargs for reconnects Is this connection is closed Make robust connection to the broker. That means that connection state will be restored after reconnect. After connection has been established the chann... | 2.088634 | 2 |
example/0_Basic_usage_of_the_library/openCV/18-对象测量.py | RecluseXU/learning_spider | 38 | 6633195 | # -*- encoding: utf-8 -*-
'''
@Time : 2018-3-27
@Author : EvilRecluse
@Contact : https://github.com/RecluseXU
@Desc : 对象测量
弧长与面积
计算单位是像素
计算弧长和面积的前提条件是进行 轮廓发现
多边形拟合
获取轮廓的多边形拟合效果
approxPolyDP
contour
epsilon 越小折线越逼近真实形状
close 是否为封闭区域
几何矩计算
... | # -*- encoding: utf-8 -*-
'''
@Time : 2018-3-27
@Author : EvilRecluse
@Contact : https://github.com/RecluseXU
@Desc : 对象测量
弧长与面积
计算单位是像素
计算弧长和面积的前提条件是进行 轮廓发现
多边形拟合
获取轮廓的多边形拟合效果
approxPolyDP
contour
epsilon 越小折线越逼近真实形状
close 是否为封闭区域
几何矩计算
... | zh | 0.882079 | # -*- encoding: utf-8 -*- @Time : 2018-3-27 @Author : EvilRecluse @Contact : https://github.com/RecluseXU @Desc : 对象测量 弧长与面积 计算单位是像素 计算弧长和面积的前提条件是进行 轮廓发现 多边形拟合 获取轮廓的多边形拟合效果 approxPolyDP contour epsilon 越小折线越逼近真实形状 close 是否为封闭区域 几何矩计算 ... | 2.825117 | 3 |
generate_test_src.py | rysiof/makefile-template | 1 | 6633196 | #! /usr/bin/python
# MIT License
#
# Copyright (c) 2020 <EMAIL>
#
# 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, ... | #! /usr/bin/python
# MIT License
#
# Copyright (c) 2020 <EMAIL>
#
# 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, ... | en | 0.552536 | #! /usr/bin/python # MIT License # # Copyright (c) 2020 <EMAIL> # # 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, ... | 1.881361 | 2 |
PyBS/rpcclient.py | thusser/pybs | 0 | 6633197 | import asyncio
import json
class RpcError(Exception):
"""Exception for all RPC errors."""
pass
class RpcClient:
"""Client for remote procedure calls."""
def __init__(self, host: str = 'localhost', port: int = 16219):
"""Create a new RPC client.
Args:
host: Hostname of s... | import asyncio
import json
class RpcError(Exception):
"""Exception for all RPC errors."""
pass
class RpcClient:
"""Client for remote procedure calls."""
def __init__(self, host: str = 'localhost', port: int = 16219):
"""Create a new RPC client.
Args:
host: Hostname of s... | en | 0.73724 | Exception for all RPC errors. Client for remote procedure calls. Create a new RPC client. Args: host: Hostname of server. port: Port on server to connect to. Calls a command on the server. Args: command: Name of command to run. **kwargs: Parameters for c... | 3.110602 | 3 |
examples/sequencer_scripting422.py | DreamingPoet/UnrealEnginePython | 14 | 6633198 | # the Sequencer API support has been sponsored by <NAME> (http://www.mattwhelan.com/)
import unreal_engine as ue
from unreal_engine.classes import MovieSceneAudioTrack, LevelSequenceFactoryNew, MovieSceneSkeletalAnimationTrack, Character, SkeletalMesh, MovieScene3DTransformTrack, CineCameraActor, AnimSequence
import t... | # the Sequencer API support has been sponsored by <NAME> (http://www.mattwhelan.com/)
import unreal_engine as ue
from unreal_engine.classes import MovieSceneAudioTrack, LevelSequenceFactoryNew, MovieSceneSkeletalAnimationTrack, Character, SkeletalMesh, MovieScene3DTransformTrack, CineCameraActor, AnimSequence
import t... | en | 0.899719 | # the Sequencer API support has been sponsored by <NAME> (http://www.mattwhelan.com/) # create a new level sequence asset # add an audio track (without sound section ;) to the sequence # get a reference to the editor world (to spawn actors) # spawn a new character and modify it (post_edit_change will allow the editor/s... | 2.209326 | 2 |
job/src/scripts/job_distributor_nuvlabox_state_check.py | slipstream/SlipStreamJobEngine | 0 | 6633199 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import time
from slipstream.job.base import main
from slipstream.job.distributor import Distributor
from slipstream.job.util import override
class NuvlaBoxStateCheckDistributor(Distributor):
ACTION_NAME = 'nuvlabox_state_check'
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import time
from slipstream.job.base import main
from slipstream.job.distributor import Distributor
from slipstream.job.util import override
class NuvlaBoxStateCheckDistributor(Distributor):
ACTION_NAME = 'nuvlabox_state_check'
... | en | 0.411553 | #!/usr/bin/env python # -*- coding: utf-8 -*- # 10 minutes | 2.09704 | 2 |
11-things/tf-11-one.py | BestByte/exercises-in-programming-style | 0 | 6633200 | import sys,re,operator,string
from abc import ABCMeta
class InfoAbstaract():
__metaclass__=ABCMeta
def info(self):
return self.__class__.__name__
class DataStore(InfoAbstaract):
'''
'''
def __init__(self,path_to_file):
with open(path_to_file) as f:
self._data=f.read()... | import sys,re,operator,string
from abc import ABCMeta
class InfoAbstaract():
__metaclass__=ABCMeta
def info(self):
return self.__class__.__name__
class DataStore(InfoAbstaract):
'''
'''
def __init__(self,path_to_file):
with open(path_to_file) as f:
self._data=f.read()... | en | 0.22195 | 词汇统计 # # The main function # | 3.04124 | 3 |
texar/tf/data/data/data_iterators_test.py | jiajunhua/asyml-texar | 1 | 6633201 | # -*- coding: utf-8 -*-
#
"""
Unit tests for data iterator related operations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# pylint: disable=no-member, invalid-name
import tempfile
import numpy as np
import ... | # -*- coding: utf-8 -*-
#
"""
Unit tests for data iterator related operations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# pylint: disable=no-member, invalid-name
import tempfile
import numpy as np
import ... | en | 0.533525 | # -*- coding: utf-8 -*- # Unit tests for data iterator related operations. # pylint: disable=no-member, invalid-name Tests data iterators. # Create data Tests iterating over a single dataset. Tests iterating over multiple datasets. # Iterates over train data # Iterates over test data Tests :class:`texar.tf.data.TrainTe... | 2.667186 | 3 |
fetch_data.py | buttercrab/movie-trend | 0 | 6633202 | <filename>fetch_data.py<gh_stars>0
import argparse
import json
import urllib.parse
from datetime import datetime
from datetime import timedelta
from urllib.request import urlopen
import requests
from bs4 import BeautifulSoup
secret_key = ''
conf = json.loads(open('data/conf.json', 'r').readline())
parser = argparse.... | <filename>fetch_data.py<gh_stars>0
import argparse
import json
import urllib.parse
from datetime import datetime
from datetime import timedelta
from urllib.request import urlopen
import requests
from bs4 import BeautifulSoup
secret_key = ''
conf = json.loads(open('data/conf.json', 'r').readline())
parser = argparse.... | none | 1 | 3.176602 | 3 | |
lib/common.py | ChipsnMedia/vaapi-fits | 0 | 6633203 | ###
### Copyright (C) 2018-2019 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
from datetime import datetime as dt
import functools
import os
import slash
import subprocess
import threading
import time
def sorted_by_resolution(cases):
size = lambda kv: kv[1]["width"] * kv[1]["height"]
return ... | ###
### Copyright (C) 2018-2019 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
from datetime import datetime as dt
import functools
import os
import slash
import subprocess
import threading
import time
def sorted_by_resolution(cases):
size = lambda kv: kv[1]["width"] * kv[1]["height"]
return ... | en | 0.803074 | ### ### Copyright (C) 2018-2019 Intel Corporation ### ### SPDX-License-Identifier: BSD-3-Clause ### # Keep track of the number of times this function was called from the # current test context. This allows us to use a unique label for the # test details. # try to 'gently' terminate proc # wait a little longer for proc... | 2.09659 | 2 |
melusine/nlp_tools/stemmer.py | DataFactory-Verlingue/dafa_melusine | 1 | 6633204 | <reponame>DataFactory-Verlingue/dafa_melusine<gh_stars>1-10
import logging
from nltk.stem import SnowballStemmer
logger = logging.getLogger(__name__)
class Stemmer:
"""Compute list Series which return the stemmed version of a list of tokens
Stemming is the process of reducing a word to its word stem that aff... | import logging
from nltk.stem import SnowballStemmer
logger = logging.getLogger(__name__)
class Stemmer:
"""Compute list Series which return the stemmed version of a list of tokens
Stemming is the process of reducing a word to its word stem that affixes to suffixes and prefixes or to the roots of words.
... | en | 0.409131 | Compute list Series which return the stemmed version of a list of tokens Stemming is the process of reducing a word to its word stem that affixes to suffixes and prefixes or to the roots of words. Parameters ---------- input_column : str, Column of pd.Dataframe which contains a list of tokens, ... | 3.657409 | 4 |
user_program/old/test.py | DaveRichmond/USB4VC | 78 | 6633205 | <reponame>DaveRichmond/USB4VC
for x in range(32):
print(hex(x), '', end='') | for x in range(32):
print(hex(x), '', end='') | none | 1 | 2.991596 | 3 | |
person_tracker/code/utils/streaming.py | beetecu/continous_monitoring | 1 | 6633206 | <gh_stars>1-10
"""
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | """
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | en | 0.857463 | Copyright (c) 2019 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so... | 1.884533 | 2 |
lib/distributions/delta.py | joelouismarino/variational_rl | 15 | 6633207 | <filename>lib/distributions/delta.py
import torch
import numpy as np
from numbers import Number
from torch.distributions import constraints
from torch.distributions import Distribution
from torch.distributions.utils import broadcast_all
class Delta(Distribution):
arg_constraints = {'loc': constraints.real}
s... | <filename>lib/distributions/delta.py
import torch
import numpy as np
from numbers import Number
from torch.distributions import constraints
from torch.distributions import Distribution
from torch.distributions.utils import broadcast_all
class Delta(Distribution):
arg_constraints = {'loc': constraints.real}
s... | en | 0.467346 | # broadcast_all(loc) | 2.333567 | 2 |
yt_dlp/extractor/skyit.py | nxtreaming/yt-dlp | 11 | 6633208 | from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
dict_get,
int_or_none,
parse_duration,
unified_timestamp,
)
class SkyItPlayerIE(InfoExtractor):
IE_NAME = 'player.sky.it'
_VALID_URL = r'https?://player\.sky\... | from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
dict_get,
int_or_none,
parse_duration,
unified_timestamp,
)
class SkyItPlayerIE(InfoExtractor):
IE_NAME = 'player.sky.it'
_VALID_URL = r'https?://player\.sky\... | en | 0.230158 | # http://static.sky.it/static/skyplayer/conf.json #]+)' # m3u8 download #]+)' #]+)' #]+)' | 2.065862 | 2 |
localization_service/database.py | vladbragoi/indoor_localization_system | 0 | 6633209 | import configparser
import csv
from cloudant.client import CouchDB, CouchDatabase
from cloudant.design_document import DesignDocument
from cloudant.query import Query
from data import Data
from utils import inherit_docstring
from node import Node
ID_KEY = 'id'
X_KEY = 'x'
Y_KEY = 'y'
BORDERS_KEY = 'borders'
DIRECTIO... | import configparser
import csv
from cloudant.client import CouchDB, CouchDatabase
from cloudant.design_document import DesignDocument
from cloudant.query import Query
from data import Data
from utils import inherit_docstring
from node import Node
ID_KEY = 'id'
X_KEY = 'x'
Y_KEY = 'y'
BORDERS_KEY = 'borders'
DIRECTIO... | en | 0.672612 | # TYPE_KEY = 'type' # feature not used Starts the connection with the server, which parameters are specified in the configuration file: config.ini. This function creates a localization db instance and returns it to the caller. :return localization_db_instance: the instance # Add filter function # ignore do... | 2.538249 | 3 |
src/pyrtable/query.py | vilarneto/pyrtable | 6 | 6633210 | <reponame>vilarneto/pyrtable<filename>src/pyrtable/query.py
import collections.abc
from typing import TYPE_CHECKING, Generic, Iterable, Iterator, TypeVar, Type, Optional
from ._baseandtable import _BaseAndTableSettableProtocol, BaseAndTable
if TYPE_CHECKING:
from .filters.base import BaseFilter
from .record ... | import collections.abc
from typing import TYPE_CHECKING, Generic, Iterable, Iterator, TypeVar, Type, Optional
from ._baseandtable import _BaseAndTableSettableProtocol, BaseAndTable
if TYPE_CHECKING:
from .filters.base import BaseFilter
from .record import BaseRecord
RT = TypeVar('RT', bound='BaseRecord')
Q... | en | 0.844858 | A (potentially under construction) query for records in a table. Also represents the starting point for queries to be made over a :class:`BaseRecord` derived class, exposed through the `objects` class attribute. Change the query's base ID. :return: The resulting query. Change the query's table ID. ... | 2.400699 | 2 |
helpers.py | AnJ95/CoP-Bot | 2 | 6633211 | from telegram import Update, Message, Bot
from telegram.ext import CallbackContext
from state import state
def admin(method):
def secured(update: Update, context: CallbackContext):
msg: Message = update.message
if not state.check_admin(msg.from_user):
context.bot.send_message(msg.chat... | from telegram import Update, Message, Bot
from telegram.ext import CallbackContext
from state import state
def admin(method):
def secured(update: Update, context: CallbackContext):
msg: Message = update.message
if not state.check_admin(msg.from_user):
context.bot.send_message(msg.chat... | en | 0.233171 | # 'private', 'group', 'supergroup' or 'channel' | 2.567292 | 3 |
situation/settings.tmpl.py | chriskuehl/kloudless-status | 0 | 6633212 | # Notice:
# If you are running this in production environment, generate
# these for your app at https://dev.twitter.com/apps/new
TWITTER = {
'AUTH': {
'consumer_key': 'XXXX',
'consumer_secret': 'XXXX',
'token': 'XXXX',
'token_secret': 'XXXX',
}
}
# The e-mail address to send no... | # Notice:
# If you are running this in production environment, generate
# these for your app at https://dev.twitter.com/apps/new
TWITTER = {
'AUTH': {
'consumer_key': 'XXXX',
'consumer_secret': 'XXXX',
'token': 'XXXX',
'token_secret': 'XXXX',
}
}
# The e-mail address to send no... | en | 0.884892 | # Notice: # If you are running this in production environment, generate # these for your app at https://dev.twitter.com/apps/new # The e-mail address to send notifications from # Currently DASHBOARD does not send out notifications | 1.727078 | 2 |
model.py | robinmemminger/auditor1 | 0 | 6633213 | from sqlalchemy import Column, String, Integer, Float, DateTime, Boolean, BigInteger
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def set_table(table, merge):
class Database(Base):
__tablename__ = table
SortingIndex = Column(Integer)
ItemType = Column(... | from sqlalchemy import Column, String, Integer, Float, DateTime, Boolean, BigInteger
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def set_table(table, merge):
class Database(Base):
__tablename__ = table
SortingIndex = Column(Integer)
ItemType = Column(... | none | 1 | 2.309415 | 2 | |
ale/drivers/__init__.py | kaitlyndlee/ale | 0 | 6633214 | import pvl
import zlib
import importlib
import inspect
import itertools
from itertools import chain
import os
from glob import glob
import json
import numpy as np
import datetime
from datetime import datetime, date
import traceback
from collections import OrderedDict
from ale.formatters.usgscsm_formatter import to_us... | import pvl
import zlib
import importlib
import inspect
import itertools
from itertools import chain
import os
from glob import glob
import json
import numpy as np
import datetime
from datetime import datetime, date
import traceback
from collections import OrderedDict
from ale.formatters.usgscsm_formatter import to_us... | en | 0.68439 | # dynamically load drivers Attempt to load a given label from all possible drivers Parameters ---------- label : str String path to the given label file # get instrument_id to force early failure | 2.128569 | 2 |
class6/exercises/ex7_pynxos_config.py | ktbyers/python_course | 24 | 6633215 | <filename>class6/exercises/ex7_pynxos_config.py<gh_stars>10-100
#!/usr/bin/env python
"""
Use the pynxos library to configure a loopback interface on nxos1. Choose a random
loopback interface number between 1 and 99.
Assign the loopback interface an IP address in the 172.16.0.0 - 172.31.255.255. Use
a /32 netmask.
Ex... | <filename>class6/exercises/ex7_pynxos_config.py<gh_stars>10-100
#!/usr/bin/env python
"""
Use the pynxos library to configure a loopback interface on nxos1. Choose a random
loopback interface number between 1 and 99.
Assign the loopback interface an IP address in the 172.16.0.0 - 172.31.255.255. Use
a /32 netmask.
Ex... | en | 0.599688 | #!/usr/bin/env python Use the pynxos library to configure a loopback interface on nxos1. Choose a random loopback interface number between 1 and 99. Assign the loopback interface an IP address in the 172.16.0.0 - 172.31.255.255. Use a /32 netmask. Execute a 'show run interface loopbackX' command using NX-API to verif... | 2.773991 | 3 |
fsociety/information_gathering/sublist3r.py | mehedieh/fsociety | 0 | 6633216 | import os
from fsociety.core.repo import GitHubRepo
from fsociety.core.menu import set_readline
class Sublist3rRepo(GitHubRepo):
def __init__(self):
super().__init__(
path="aboul3la/Sublist3r",
install={"pip": "requirements.txt"},
description=
"Fast subdoma... | import os
from fsociety.core.repo import GitHubRepo
from fsociety.core.menu import set_readline
class Sublist3rRepo(GitHubRepo):
def __init__(self):
super().__init__(
path="aboul3la/Sublist3r",
install={"pip": "requirements.txt"},
description=
"Fast subdoma... | none | 1 | 2.135294 | 2 | |
apps/courses/migrations/0001_initial.py | bopopescu/diandian_online | 3 | 6633217 | # Generated by Django 2.1.7 on 2019-02-19 18:44
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Chapter',... | # Generated by Django 2.1.7 on 2019-02-19 18:44
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Chapter',... | en | 0.751872 | # Generated by Django 2.1.7 on 2019-02-19 18:44 | 1.815694 | 2 |
supcon/models.py | deepneuralmachine/google-research | 23,901 | 6633218 | <gh_stars>1000+
# coding=utf-8
# Copyright 2021 The Google Research 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 requ... | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | en | 0.799581 | # coding=utf-8 # Copyright 2021 The Google Research 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 applicab... | 2.235243 | 2 |
parser/fase2/team20/execution/execute.py | diegog56/tytus | 0 | 6633219 | #Importacion de metodos de ejecucion
#Se utilizan archivos separados para minimizar los conflictos
from .AST.sentence import *
from .executeSentence import executeSentence
from .executeSentence2 import executeSentence2
from .executeInstruction import executeInstruction
from .generateASTReport import graphAST
from .gene... | #Importacion de metodos de ejecucion
#Se utilizan archivos separados para minimizar los conflictos
from .AST.sentence import *
from .executeSentence import executeSentence
from .executeSentence2 import executeSentence2
from .executeInstruction import executeInstruction
from .generateASTReport import graphAST
from .gene... | es | 0.679081 | #Importacion de metodos de ejecucion #Se utilizan archivos separados para minimizar los conflictos # Python3 # cada item es un diccionario {resultado,argumento1,argumento2,operacion} #intermediate = IntermediateFunctions() # def __init__(self, nodes, errors): # self.nodes = nodes # self.errors = errors #Aqui va... | 2.511562 | 3 |
deepfashion2/extract_subset_of_files.py | chaoso/Detectron2-deepfashion2 | 3 | 6633220 | import shutil
import time
import os
tic = time.time()
NUMBER_OF_SAMPLES_TRAIN = 1000
NUMBER_OF_SAMPLES_VALIDATION = 300
TRAINING_IMAGE_FILE_PATH = "F:\\Downloads\\train\\train\\image"
VALIDATION_IMAGE_FILE_PATH = "F:\\Downloads\\validation\\validation\\image"
DST_VALIDATION_IMAGE_FILE_PATH = "F:\\mini_deepfashion2\... | import shutil
import time
import os
tic = time.time()
NUMBER_OF_SAMPLES_TRAIN = 1000
NUMBER_OF_SAMPLES_VALIDATION = 300
TRAINING_IMAGE_FILE_PATH = "F:\\Downloads\\train\\train\\image"
VALIDATION_IMAGE_FILE_PATH = "F:\\Downloads\\validation\\validation\\image"
DST_VALIDATION_IMAGE_FILE_PATH = "F:\\mini_deepfashion2\... | none | 1 | 2.465411 | 2 | |
f1Scheduler.py | thaldi/f1CalenderNotify | 2 | 6633221 | <gh_stars>1-10
import HtmlHelper as htmlHelper
import datetime as dt
import ToastHelper as toast
baseUrl = "https://www.formula1.com"
parser = htmlHelper.HtmlParserHelper("{}/en/racing/2019.html".format(baseUrl))
allElements = parser.GetElements()
def ClearRaceDateValue(values):
dateValues = values.split("-")
... | import HtmlHelper as htmlHelper
import datetime as dt
import ToastHelper as toast
baseUrl = "https://www.formula1.com"
parser = htmlHelper.HtmlParserHelper("{}/en/racing/2019.html".format(baseUrl))
allElements = parser.GetElements()
def ClearRaceDateValue(values):
dateValues = values.split("-")
raceDay = d... | none | 1 | 2.986205 | 3 | |
shsa/uc_print.py | dratasich/shsa | 0 | 6633222 | <reponame>dratasich/shsa
#!/usr/bin/python3
"""Prints a SHSA model."""
import argparse
from model.shsamodel import SHSAModel, SHSANodeType
# parse optional config file
parser = argparse.ArgumentParser(description="""Execute SHSA engines given a
config file.""")
parser.add_argument('-m', '--model', type=str,
... | #!/usr/bin/python3
"""Prints a SHSA model."""
import argparse
from model.shsamodel import SHSAModel, SHSANodeType
# parse optional config file
parser = argparse.ArgumentParser(description="""Execute SHSA engines given a
config file.""")
parser.add_argument('-m', '--model', type=str,
default="../c... | en | 0.365517 | #!/usr/bin/python3 Prints a SHSA model. # parse optional config file Execute SHSA engines given a config file. # yaml example | 2.900431 | 3 |
hasher-matcher-actioner/hmalib/lambdas/pdq/pdq_indexer.py | ekmixon/ThreatExchange | 0 | 6633223 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
import os
import pickle
import typing as t
from functools import reduce
from urllib.parse import unquote_plus
import boto3
from threatexchange.signal_type.pdq_index import PDQIndex
from hmalib import metrics
from hmalib.common.loggin... | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
import os
import pickle
import typing as t
from functools import reduce
from urllib.parse import unquote_plus
import boto3
from threatexchange.signal_type.pdq_index import PDQIndex
from hmalib import metrics
from hmalib.common.loggin... | en | 0.810003 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # TODO: This will attempt to load all pdq files everytime any pdq file is updated # so if files are updated for c collaborations it will lead to c^2 files being read # this can be optimized by no longer being event based but instead running on # a t... | 1.963047 | 2 |
quick_cgmod.py | franknu/cgmodsel | 1 | 6633224 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME> (<EMAIL>), 2020
Demo for
Nussbaum, F. & <NAME>. (2020). Pairwise sparse + low-rank models for variables of mixed type.
Journal of Multivariate Analysis, 2020.
If you use this software, please consider citing this article.
"""
# pylint: disable=C0103
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME> (<EMAIL>), 2020
Demo for
Nussbaum, F. & <NAME>. (2020). Pairwise sparse + low-rank models for variables of mixed type.
Journal of Multivariate Analysis, 2020.
If you use this software, please consider citing this article.
"""
# pylint: disable=C0103
... | en | 0.569747 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- @author: <NAME> (<EMAIL>), 2020 Demo for Nussbaum, F. & <NAME>. (2020). Pairwise sparse + low-rank models for variables of mixed type. Journal of Multivariate Analysis, 2020. If you use this software, please consider citing this article. # pylint: disable=C0103 # functio... | 2.54918 | 3 |
section-20-modules/greet.py | mugan86/bootcamp-basic-to-expert-from-scratch | 31 | 6633225 | <filename>section-20-modules/greet.py
# Saludos a la persona indicada
def hello(name):
return f'Hola {name}'
def goodbye(name):
return f'Adios {name}' | <filename>section-20-modules/greet.py
# Saludos a la persona indicada
def hello(name):
return f'Hola {name}'
def goodbye(name):
return f'Adios {name}' | es | 0.848734 | # Saludos a la persona indicada | 1.826949 | 2 |
eggs/bx_python-0.7.2-py2.6-linux-x86_64-ucs4.egg/EGG-INFO/scripts/bed_intersect.py | psnehal/MethylSig | 0 | 6633226 | #!/afs/bx.psu.edu/project/pythons/py2.6-linux-x86_64-ucs4/bin/python2.6
"""
Find regions of first bed file that overlap regions in a second bed file. The
output preserves all fields from the input.
NOTE: -u and -d options are currently not functional!
usage: %prog bed_file_1 bed_file_2
-m, --mincols=N: Require ... | #!/afs/bx.psu.edu/project/pythons/py2.6-linux-x86_64-ucs4/bin/python2.6
"""
Find regions of first bed file that overlap regions in a second bed file. The
output preserves all fields from the input.
NOTE: -u and -d options are currently not functional!
usage: %prog bed_file_1 bed_file_2
-m, --mincols=N: Require ... | en | 0.738765 | #!/afs/bx.psu.edu/project/pythons/py2.6-linux-x86_64-ucs4/bin/python2.6 Find regions of first bed file that overlap regions in a second bed file. The output preserves all fields from the input. NOTE: -u and -d options are currently not functional! usage: %prog bed_file_1 bed_file_2 -m, --mincols=N: Require this ... | 2.715716 | 3 |
src/openprocurement/tender/limited/includeme.py | ProzorroUKR/openprocurement.api | 10 | 6633227 | # -*- coding: utf-8 -*-
from logging import getLogger
from pyramid.interfaces import IRequest
from openprocurement.api.interfaces import IContentConfigurator
from openprocurement.tender.limited.models import (
ReportingTender,
NegotiationTender,
NegotiationQuickTender,
IReportingTender,
INegotiation... | # -*- coding: utf-8 -*-
from logging import getLogger
from pyramid.interfaces import IRequest
from openprocurement.api.interfaces import IContentConfigurator
from openprocurement.tender.limited.models import (
ReportingTender,
NegotiationTender,
NegotiationQuickTender,
IReportingTender,
INegotiation... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.915789 | 2 |
qr.py | guenter-r/QR_code_command_line | 0 | 6633228 | """
Just an quick implementation for a fully private QR code generator.
"""
import qrcode
from string import punctuation
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
print('Text to QR-tify:')
input_data = input()
qr.add_dat... | """
Just an quick implementation for a fully private QR code generator.
"""
import qrcode
from string import punctuation
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
print('Text to QR-tify:')
input_data = input()
qr.add_dat... | en | 0.584415 | Just an quick implementation for a fully private QR code generator. # while qr_color not in colors: # qr_color = input() # while qr_back not in colors: # qr_back = input() # create img file # Save file -> name from QR input # Save QR code | 3.074111 | 3 |
lfs_project/lfs/tests.py | ailov99/lfs | 0 | 6633229 | from django.test import TestCase, Client
from django.contrib.auth.models import User, AnonymousUser
from models import Teacher, Module, Takers, Page, ContentFile
class UserAppTests(TestCase):
def setUp(self):
self.c = Client()
self.user = User.objects.create_user("jdoe",
... | from django.test import TestCase, Client
from django.contrib.auth.models import User, AnonymousUser
from models import Teacher, Module, Takers, Page, ContentFile
class UserAppTests(TestCase):
def setUp(self):
self.c = Client()
self.user = User.objects.create_user("jdoe",
... | en | 0.798145 | On registering, a new user is created, tied to an 'empty' Teacher model # Assure DB is properly populated with correct data Correct registration POST will result in a properly populated DB with both User and Teacher # attempt to send data which does not comply with the Terms and Cond # send terms-co... | 2.714148 | 3 |
pout/path.py | Jaymon/pout | 25 | 6633230 | <reponame>Jaymon/pout<filename>pout/path.py<gh_stars>10-100
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
import os
import logging
import sys
import site
import inspect
from .compat import String
logger = logging.getLogger(__name__)
class Path(String):
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
import os
import logging
import sys
import site
import inspect
from .compat import String
logger = logging.getLogger(__name__)
class Path(String):
"""Returns a path string relative to the current working ... | en | 0.813384 | # -*- coding: utf-8 -*- Returns a path string relative to the current working directory (if applicable) Finds the site-packages directory and sets the value of this string to that path # we are probably running this in a virtualenv, so let's try a different # approach # try and brute-force discover it since it's no... | 2.350249 | 2 |
examples/gcharttestapp/TestGChart05.py | allbuttonspressed/pyjs | 1 | 6633231 | <gh_stars>1-10
import GChartTestAppUtil
from pyjamas.chart.GChart import GChart
from pyjamas.chart import GChartConsts
from pyjamas.chart import SymbolType
# test that clipping of points to plot area works as expected
class TestGChart05 (GChart):
def __init__(self, testCanvas):
GChart.__init__(self, XChar... | import GChartTestAppUtil
from pyjamas.chart.GChart import GChart
from pyjamas.chart import GChartConsts
from pyjamas.chart import SymbolType
# test that clipping of points to plot area works as expected
class TestGChart05 (GChart):
def __init__(self, testCanvas):
GChart.__init__(self, XChartSize=300,YChar... | en | 0.871037 | # test that clipping of points to plot area works as expected # clipped # clipped # clipped # clipped # continuous line whose edges self.get clipped off # self.getCurve().addPoint(50,-50) # self.getCurve().addPoint(50,-50) # this should be entirely visible # this should be entirely clipped. # this should be ent... | 2.64535 | 3 |
climatology.py | oet808/PDO_CMIP5 | 0 | 6633232 | #!/usr/bin/python
###############################################################################
# Script that calls CDO
# linux command to calculate the long-term climatology
# (from annual mean data)
###############################################################################
import os
#import sys
#sys.path.appe... | #!/usr/bin/python
###############################################################################
# Script that calls CDO
# linux command to calculate the long-term climatology
# (from annual mean data)
###############################################################################
import os
#import sys
#sys.path.appe... | en | 0.570109 | #!/usr/bin/python ############################################################################### # Script that calls CDO # linux command to calculate the long-term climatology # (from annual mean data) ############################################################################### #import sys #sys.path.append("./modul... | 2.345797 | 2 |
opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py | pitabwire/opentelemetry-python-contrib | 0 | 6633233 | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | en | 0.803107 | # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ... | 2.138265 | 2 |
profiles_api/serializers.py | elolugo/profiles-res-api | 0 | 6633234 | <reponame>elolugo/profiles-res-api
from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
"""
Serializes a name field for testing our APIView.
Converts and validates the inputs to the methods
of an API
"""
name = serializers.CharFi... | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
"""
Serializes a name field for testing our APIView.
Converts and validates the inputs to the methods
of an API
"""
name = serializers.CharField(max_length=10)
class UserProf... | en | 0.77519 | Serializes a name field for testing our APIView. Converts and validates the inputs to the methods of an API Serializes an user profile object # Making exceptions in the password filed # can only be writable and not readable # treat as a password field in the input form After validating the data by the serialize... | 2.925701 | 3 |
ddi_search_engine/Bio/Mindy/compression.py | dbmi-pitt/DIKB-Evidence-analytics | 3 | 6633235 | import commands, os
_uncompress_table = {
".bz": "bzip2",
".BZ": "bzip2",
".gz": "gzip",
".GZ": "gzip",
".Z": "compress",
}
def open_file(filename, mode = "rb"):
ext = os.path.splitext(filename)[1]
type = _uncompress_table.get(ext)
if type is None:
return open(filename, mod... | import commands, os
_uncompress_table = {
".bz": "bzip2",
".BZ": "bzip2",
".gz": "gzip",
".GZ": "gzip",
".Z": "compress",
}
def open_file(filename, mode = "rb"):
ext = os.path.splitext(filename)[1]
type = _uncompress_table.get(ext)
if type is None:
return open(filename, mod... | none | 1 | 3.077736 | 3 | |
google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/compute/managed_instance_groups_utils.py | KaranToor/MA450 | 1 | 6633236 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | en | 0.759545 | # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag... | 1.70726 | 2 |
project_version/constants.py | dmytrostriletskyi/project-version | 7 | 6633237 | """
Provide constant for command line interface.
"""
SUCCESSFUL_EXIT_CODE = 0
FAILED_EXIT_CODE = 1
GIT_HUB_PROVIDER = 'GitHub'
SUPPORTED_PROVIDERS = [GIT_HUB_PROVIDER]
| """
Provide constant for command line interface.
"""
SUCCESSFUL_EXIT_CODE = 0
FAILED_EXIT_CODE = 1
GIT_HUB_PROVIDER = 'GitHub'
SUPPORTED_PROVIDERS = [GIT_HUB_PROVIDER]
| en | 0.852776 | Provide constant for command line interface. | 1.035439 | 1 |
tony-examples/horovod-on-tony/horovod_debug_driver.py | ashahab/TonY | 645 | 6633238 | <filename>tony-examples/horovod-on-tony/horovod_debug_driver.py
#
# Copyright 2021 LinkedIn Corporation. All rights reserved. Licensed under the
# BSD-2 Clause license. See LICENSE in the project root for license information.
#
import os
import logging
import time
from optparse import OptionParser
import sys
import si... | <filename>tony-examples/horovod-on-tony/horovod_debug_driver.py
#
# Copyright 2021 LinkedIn Corporation. All rights reserved. Licensed under the
# BSD-2 Clause license. See LICENSE in the project root for license information.
#
import os
import logging
import time
from optparse import OptionParser
import sys
import si... | en | 0.751865 | # # Copyright 2021 LinkedIn Corporation. All rights reserved. Licensed under the # BSD-2 Clause license. See LICENSE in the project root for license information. # # worker_list = "localhost:1" # todo: Close rendezvous server. # Just for Unit Test | 2.036106 | 2 |
pyro/contrib/epidemiology/__init__.py | garrett-bernstein/pyro | 0 | 6633239 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from .compartmental import CompartmentalModel
from .distributions import beta_binomial_dist, binomial_dist, infection_dist
__all__ = [
"CompartmentalModel",
"beta_binomial_dist",
"binomial_dist",
"infection_dist",
]
| # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from .compartmental import CompartmentalModel
from .distributions import beta_binomial_dist, binomial_dist, infection_dist
__all__ = [
"CompartmentalModel",
"beta_binomial_dist",
"binomial_dist",
"infection_dist",
]
| en | 0.459 | # Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 | 1.145195 | 1 |
src/ext/api/__init__.py | uesleicarvalhoo/FlaskBoilerplate | 0 | 6633240 | from flask import Flask
def init_app(app: Flask) -> None:
pass
| from flask import Flask
def init_app(app: Flask) -> None:
pass
| none | 1 | 1.089447 | 1 | |
setup.py | tgadf/movies | 0 | 6633241 | from distutils.core import setup
import setuptools
setup(
name = 'movies',
py_modules = ['AACTA',
'filmsite',
'razzies',
'BAFTA',
'flops',
'rollingstone',
'SAG',
'goldenglobes',
'rottentomatoes',
'amc',
'movieDB',
'setup',
'boxofficemojo',
'movieRenames',
'ultimatemovierankings',
'canada',
'movies'... | from distutils.core import setup
import setuptools
setup(
name = 'movies',
py_modules = ['AACTA',
'filmsite',
'razzies',
'BAFTA',
'flops',
'rollingstone',
'SAG',
'goldenglobes',
'rottentomatoes',
'amc',
'movieDB',
'setup',
'boxofficemojo',
'movieRenames',
'ultimatemovierankings',
'canada',
'movies'... | zh | 0.347785 | #egg=utils-0.0.1'] | 1.232881 | 1 |
tests/run_py27.py | radluz/fakear | 2 | 6633242 | import subprocess
class PopenAdapter:
def __init__(self, stdout, stderr, retcode):
self.stdout = stdout
self.stderr = stderr
self.returncode = retcode
def run(*args, **kwargs):
p = subprocess.Popen(*args, **kwargs)
out, err = p.communicate()
return PopenAdapter(out, err, p.retu... | import subprocess
class PopenAdapter:
def __init__(self, stdout, stderr, retcode):
self.stdout = stdout
self.stderr = stderr
self.returncode = retcode
def run(*args, **kwargs):
p = subprocess.Popen(*args, **kwargs)
out, err = p.communicate()
return PopenAdapter(out, err, p.retu... | none | 1 | 2.62185 | 3 | |
SpectroscoPy/Spectrum.py | faradaymahe/Phonopy-Spectroscopy | 94 | 6633243 | <filename>SpectroscoPy/Spectrum.py
# SpectroscoPy/Spectrum.py
# ---------
# Docstring
# ---------
""" Core routines for simulating spectra. """
# -------
# Imports
# -------
import math;
import numpy as np;
# ---------
# Constants
# ---------
""" To ensure the maximum is included in grids, np.arange() is call... | <filename>SpectroscoPy/Spectrum.py
# SpectroscoPy/Spectrum.py
# ---------
# Docstring
# ---------
""" Core routines for simulating spectra. """
# -------
# Imports
# -------
import math;
import numpy as np;
# ---------
# Constants
# ---------
""" To ensure the maximum is included in grids, np.arange() is call... | en | 0.672855 | # SpectroscoPy/Spectrum.py # --------- # Docstring # --------- Core routines for simulating spectra. # ------- # Imports # ------- # --------- # Constants # --------- To ensure the maximum is included in grids, np.arange() is called as np.arange(min, max + RangeStepMultiplier * step, step). A "safe" multiplier of the l... | 2.480201 | 2 |
tests/unit/services/shop/article/test_article_availability.py | homeworkprod/byceps | 23 | 6633244 | """
:Copyright: 2014-2022 <NAME>
:License: Revised BSD (see `LICENSE` file for details)
"""
from datetime import datetime
from decimal import Decimal
from typing import Optional
from freezegun import freeze_time
import pytest
from byceps.database import generate_uuid
from byceps.services.shop.article.transfer.models... | """
:Copyright: 2014-2022 <NAME>
:License: Revised BSD (see `LICENSE` file for details)
"""
from datetime import datetime
from decimal import Decimal
from typing import Optional
from freezegun import freeze_time
import pytest
from byceps.database import generate_uuid
from byceps.services.shop.article.transfer.models... | en | 0.713704 | :Copyright: 2014-2022 <NAME> :License: Revised BSD (see `LICENSE` file for details) | 2.124643 | 2 |
alive.py | konsolxnxx/Petercord-Userbotilham | 0 | 6633245 | <filename>alive.py
from pyrogram import Filters
from userbot import bot
@bot.on_message(Filters.regex("^.alive"))
def amialivedad(event):
chat = event.chat.id
message = " 𝐏𝐨𝐜𝐨𝐧𝐠 𝐎𝐧𝐥𝐞𝐧 User :)"
bot.edit_message_text(chat_id=chat, message_id="me", text=message)
| <filename>alive.py
from pyrogram import Filters
from userbot import bot
@bot.on_message(Filters.regex("^.alive"))
def amialivedad(event):
chat = event.chat.id
message = " 𝐏𝐨𝐜𝐨𝐧𝐠 𝐎𝐧𝐥𝐞𝐧 User :)"
bot.edit_message_text(chat_id=chat, message_id="me", text=message)
| none | 1 | 2.356373 | 2 | |
Artificial Intelligence/Natural Language Processing/Compute the Perplexity.py | rahamath2009/git-github.com-nishant-sethi-HackerRank | 76 | 6633246 | cross_entropy = 9.91
print (int(2 **cross_entropy )) | cross_entropy = 9.91
print (int(2 **cross_entropy )) | none | 1 | 1.627618 | 2 | |
FinalProject/MachineLearning/Perceptron/perceptron.py | CKPalk/MachineLearning | 0 | 6633247 | <filename>FinalProject/MachineLearning/Perceptron/perceptron.py
''' Work of <NAME> '''
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
def main( argv ):
try:
training_filename = argv[ 1 ]
testing_filename = argv[ 2 ]
output_filename = argv[ 3 ]... | <filename>FinalProject/MachineLearning/Perceptron/perceptron.py
''' Work of <NAME> '''
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
def main( argv ):
try:
training_filename = argv[ 1 ]
testing_filename = argv[ 2 ]
output_filename = argv[ 3 ]... | en | 0.52164 | Work of <NAME> Perceptron # Hyper Parameters: # Fit Classifier # Report results # | 3.466509 | 3 |
iogt_users/middlewares.py | unicef/io | 20 | 6633248 | <reponame>unicef/io
from django.shortcuts import redirect
from django.urls import resolve
from home.models import SiteSettings
class RegistrationSurveyRedirectMiddleware:
"""
The purpose of this middleware is to make the registration survey form
mandatory. See https://github.com/unicef/iogt/issues/113 fo... | from django.shortcuts import redirect
from django.urls import resolve
from home.models import SiteSettings
class RegistrationSurveyRedirectMiddleware:
"""
The purpose of this middleware is to make the registration survey form
mandatory. See https://github.com/unicef/iogt/issues/113 for details
"""
... | en | 0.86099 | The purpose of this middleware is to make the registration survey form mandatory. See https://github.com/unicef/iogt/issues/113 for details | 2.262813 | 2 |
maju/conector/mysql/__init__.py | ymussi/maju-playlist | 0 | 6633249 | import os
from sqlalchemy import create_engine
from maju.config import read_config
from maju.conector.sql import SQLDBContext
def mysql_engine(schema, pool_size=1, max_overflow=25):
dbname = read_config().get("schema", schema)
con_str = read_config().get("database", dbname)
engine = create_engine("{}/{}".... | import os
from sqlalchemy import create_engine
from maju.config import read_config
from maju.conector.sql import SQLDBContext
def mysql_engine(schema, pool_size=1, max_overflow=25):
dbname = read_config().get("schema", schema)
con_str = read_config().get("database", dbname)
engine = create_engine("{}/{}".... | none | 1 | 2.693702 | 3 | |
tests/unit/modules/test_cmci_delete.py | vera-chan/ibm_zos_cics | 0 | 6633250 | <reponame>vera-chan/ibm_zos_cics
# -*- coding: utf-8 -*-
# Copyright (c) IBM Corporation 2020
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.ibm.ibm_zos_cics.plugins.modules ... | # -*- coding: utf-8 -*-
# Copyright (c) IBM Corporation 2020
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.ibm.ibm_zos_cics.plugins.modules import cmci_delete
from ansible_c... | en | 0.464769 | # -*- coding: utf-8 -*- # Copyright (c) IBM Corporation 2020 # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) # type: (CMCITestHelper) -> None # type: (CMCITestHelper) -> None # type: (CMCITestHelper) -> None # type: (CMCITestHelper) -> None # type: (CMCITestHelper) -> None | 1.783035 | 2 |