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 |
|---|---|---|---|---|---|---|---|---|---|---|
backend-tests/tests/test_account_suspension.py | drewmoseley/integration | 0 | 11100 | <filename>backend-tests/tests/test_account_suspension.py<gh_stars>0
# Copyright 2020 Northern.tech AS
#
# 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
#
# https://www.apache.or... | <filename>backend-tests/tests/test_account_suspension.py<gh_stars>0
# Copyright 2020 Northern.tech AS
#
# 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
#
# https://www.apache.or... | en | 0.835624 | # Copyright 2020 Northern.tech AS # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a... | 1.796868 | 2 |
src/RepairManager/rules/ecc_reboot_node_rule.py | RichardZhaoW/DLWorkspace | 2 | 11101 | import os, sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import json
import logging
import yaml
import requests
import time
from actions.migrate_job_action import MigrateJobAction
from actions.send_alert_action import SendAlertAction
from actions.reboot_node_action import RebootNodeAction
from action... | import os, sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import json
import logging
import yaml
import requests
import time
from actions.migrate_job_action import MigrateJobAction
from actions.send_alert_action import SendAlertAction
from actions.reboot_node_action import RebootNodeAction
from action... | en | 0.800371 | <p>As previously notified, the following node(s) require reboot due to uncorrectable ECC error:</p> <table border="1"> <tr><td>{node}</td></tr> </table><p> <p> Job <a href="{job_link}">{job_id}</a> has been paused/resumed so node(s) can be repaired.</p> # if node has been rebooted since ecc error initially dete... | 1.874083 | 2 |
work/dib-ipa-element/virtmedia-netconf/ironic-bmc-hardware-manager/src/ironic_bmc_hardware_manager/bmc.py | alexandruavadanii/ipa-deployer | 0 | 11102 | <gh_stars>0
# Copyright 2019 Nokia
#
# 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 wri... | # Copyright 2019 Nokia
#
# 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, softwa... | en | 0.857028 | # Copyright 2019 Nokia # # 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, softwa... | 1.896751 | 2 |
museum_site/context_processors.py | DrDos0016/z2 | 3 | 11103 | <reponame>DrDos0016/z2
from django.core.cache import cache
from datetime import datetime
from museum_site.models.detail import Detail
from museum_site.models.file import File
from museum_site.constants import TERMS_DATE
from museum_site.common import (
DEBUG, EMAIL_ADDRESS, BOOT_TS, CSS_INCLUDES, UPLOAD_CAP, env_... | from django.core.cache import cache
from datetime import datetime
from museum_site.models.detail import Detail
from museum_site.models.file import File
from museum_site.constants import TERMS_DATE
from museum_site.common import (
DEBUG, EMAIL_ADDRESS, BOOT_TS, CSS_INCLUDES, UPLOAD_CAP, env_from_host,
qs_sans
... | en | 0.546104 | # Debug mode # Server info # Server date/time # Drupe Day # April 1st # Common query string modifications # E-mail # CSS Files # Featured Worlds # Upload Cap # Queue size # User TOS Date checks # Force a new login | 2.045568 | 2 |
misago/users/views/avatarserver.py | HenryChenV/iJiangNan | 1 | 11104 | <reponame>HenryChenV/iJiangNan
from django.contrib.auth import get_user_model
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.shortcuts import redirect
from misago.conf import settings
UserModel = get_user_model()
def user_avatar(request, pk, size):
size = int(size)
try:... | from django.contrib.auth import get_user_model
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.shortcuts import redirect
from misago.conf import settings
UserModel = get_user_model()
def user_avatar(request, pk, size):
size = int(size)
try:
user = UserModel.objec... | none | 1 | 2.1954 | 2 | |
csbdeep/internals/nets.py | papkov/CSBDeep | 2 | 11105 | from __future__ import print_function, unicode_literals, absolute_import, division
from six.moves import range, zip, map, reduce, filter
from keras.layers import Input, Conv2D, Conv3D, Activation, Lambda
from keras.models import Model
from keras.layers.merge import Add, Concatenate
import tensorflow as tf
from keras i... | from __future__ import print_function, unicode_literals, absolute_import, division
from six.moves import range, zip, map, reduce, filter
from keras.layers import Input, Conv2D, Conv3D, Activation, Lambda
from keras.models import Model
from keras.layers.merge import Add, Concatenate
import tensorflow as tf
from keras i... | en | 0.605453 | TODO # TODO: rewrite with conv_block Multi-body U-Net which learns identity by leaving one plane out in each branch :param input_shape: :param n_depth: :param n_filter_base: :param kernel_size: :param n_conv_per_depth: :param activation: :param last_activation: :param batch_norm: :p... | 2.162591 | 2 |
src/inf/runtime_data.py | feagi/feagi-core | 11 | 11106 | <filename>src/inf/runtime_data.py
parameters = {}
genome = {}
genome_stats = {}
genome_test_stats = []
brain = {}
cortical_list = []
cortical_map = {}
intercortical_mapping = []
block_dic = {}
upstream_neurons = {}
memory_list = {}
activity_stats = {}
temp_neuron_list = []
original_genome_id = []
fire_list = []
termina... | <filename>src/inf/runtime_data.py
parameters = {}
genome = {}
genome_stats = {}
genome_test_stats = []
brain = {}
cortical_list = []
cortical_map = {}
intercortical_mapping = []
block_dic = {}
upstream_neurons = {}
memory_list = {}
activity_stats = {}
temp_neuron_list = []
original_genome_id = []
fire_list = []
termina... | en | 0.867164 | # rules = "" # live_mode_status can have modes of idle, learning, testing, tbd # Flags | 1.755369 | 2 |
scripts/topo_countries.py | taufikhe/Censof-Mini-Project | 0 | 11107 | <reponame>taufikhe/Censof-Mini-Project
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from geonamescache import GeonamesCache
gc = GeonamesCache()
toposrc = '../data/states-provinces.json'
for iso2, country in gc.get_countries().items():
iso3 = country['iso3']
topojson = 'mapshaper -i {0} -f... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from geonamescache import GeonamesCache
gc = GeonamesCache()
toposrc = '../data/states-provinces.json'
for iso2, country in gc.get_countries().items():
iso3 = country['iso3']
topojson = 'mapshaper -i {0} -filter \'"{1}" == adm0_a3\' -filter-fiel... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.347749 | 2 |
nordb/database/nordic2sql.py | MrCubanfrog/NorDB | 1 | 11108 | <reponame>MrCubanfrog/NorDB
"""
This module contains all information for pushing a NordicEvent object into the database.
Functions and Classes
---------------------
"""
import psycopg2
import os
import re
import datetime
from nordb.core import usernameUtilities
from nordb.database import creationInfo
INSERT_COMMAND... | """
This module contains all information for pushing a NordicEvent object into the database.
Functions and Classes
---------------------
"""
import psycopg2
import os
import re
import datetime
from nordb.core import usernameUtilities
from nordb.database import creationInfo
INSERT_COMMANDS = {
1:... | en | 0.739021 | This module contains all information for pushing a NordicEvent object into the database. Functions and Classes --------------------- Function that pushes a NordicEvent object to the database :param NordicEvent nordic_event: Event that will be pushed to the database :param int solution_type: event type id ... | 2.213153 | 2 |
movie_trailer_website/media.py | mradenovic/movie-trailer-website | 0 | 11109 | """This module contains class definitions for storing media files"""
import webbrowser
class Movie():
"""Movie class defines movies.
Attributes:
movie_title (str): Title of the movie
movie_storyline (str): Sort description of the movie
poster_image (str): Url of the poster image
... | """This module contains class definitions for storing media files"""
import webbrowser
class Movie():
"""Movie class defines movies.
Attributes:
movie_title (str): Title of the movie
movie_storyline (str): Sort description of the movie
poster_image (str): Url of the poster image
... | en | 0.580094 | This module contains class definitions for storing media files Movie class defines movies. Attributes: movie_title (str): Title of the movie movie_storyline (str): Sort description of the movie poster_image (str): Url of the poster image trailer_youtube (str): URL of the Youtube tra... | 3.687672 | 4 |
201-vmss-bottle-autoscale/workserver.py | kollexy/azure-quickstart-templates | 10 | 11110 | <gh_stars>1-10
# workserver.py - simple HTTP server with a do_work / stop_work API
# GET /do_work activates a worker thread which uses CPU
# GET /stop_work signals worker thread to stop
import math
import socket
import threading
import time
from bottle import route, run
hostname = socket.gethostname()
hostport = 9000... | # workserver.py - simple HTTP server with a do_work / stop_work API
# GET /do_work activates a worker thread which uses CPU
# GET /stop_work signals worker thread to stop
import math
import socket
import threading
import time
from bottle import route, run
hostname = socket.gethostname()
hostport = 9000
keepworking = ... | en | 0.862124 | # workserver.py - simple HTTP server with a do_work / stop_work API # GET /do_work activates a worker thread which uses CPU # GET /stop_work signals worker thread to stop # boolean to switch worker thread on or off # thread which maximizes CPU usage while the keepWorking global is True # outer loop to run while waiting... | 3.253499 | 3 |
year_3/databases_sem1/lab1/cli.py | honchardev/KPI | 0 | 11111 | from maxdb import DB
def runtime_on_any_exception(func):
def decorate(*args, **kwargs):
try:
func(*args, **kwargs)
except:
raise RuntimeError
return decorate
class CLIUtils(object):
DEFAULT_PATH = 'storage.json'
def __init__(self):
self._db = None
... | from maxdb import DB
def runtime_on_any_exception(func):
def decorate(*args, **kwargs):
try:
func(*args, **kwargs)
except:
raise RuntimeError
return decorate
class CLIUtils(object):
DEFAULT_PATH = 'storage.json'
def __init__(self):
self._db = None
... | en | 0.666255 | LAB1 HELP: | tables | print list of tables from current storage. | all <table> (<table> ...) | display _all values from specific table. | all labcondition | display _all products with price more than 100UAH. | insert <table> <cnt> | ... | 2.510922 | 3 |
Ar_Script/past/eg_用户信息用户界面.py | archerckk/PyTest | 0 | 11112 | <gh_stars>0
import easygui as g
# judge=1
# def judge_null(tmp):
# if tmp.isspace()or len(tmp)==0:
# return judge==0
#
# while 1:
# user_info=g.multenterbox(title='账号中心',
# msg='【*用户名】为必填项\t【*真实姓名】为必填项\t【*手机号码】为必填项\t【*E-mail】为必填项',
# fields=['*用户名','*真实姓名... | import easygui as g
# judge=1
# def judge_null(tmp):
# if tmp.isspace()or len(tmp)==0:
# return judge==0
#
# while 1:
# user_info=g.multenterbox(title='账号中心',
# msg='【*用户名】为必填项\t【*真实姓名】为必填项\t【*手机号码】为必填项\t【*E-mail】为必填项',
# fields=['*用户名','*真实姓名','固定电话','*手... | en | 0.186804 | # judge=1 # def judge_null(tmp): # if tmp.isspace()or len(tmp)==0: # return judge==0 # # while 1: # user_info=g.multenterbox(title='账号中心', # msg='【*用户名】为必填项\t【*真实姓名】为必填项\t【*手机号码】为必填项\t【*E-mail】为必填项', # fields=['*用户名','*真实姓名','固定电话','*手机号码','QQ','*E-mail'] ... | 2.534977 | 3 |
examples/pspm_pupil/model_defs.py | fmelinscak/cognibench | 3 | 11113 | from cognibench.models import CNBModel
from cognibench.capabilities import ContinuousAction, ContinuousObservation
from cognibench.continuous import ContinuousSpace
from cognibench.models.wrappers import MatlabWrapperMixin
class PsPMModel(MatlabWrapperMixin, CNBModel, ContinuousAction, ContinuousObservation):
nam... | from cognibench.models import CNBModel
from cognibench.capabilities import ContinuousAction, ContinuousObservation
from cognibench.continuous import ContinuousSpace
from cognibench.models.wrappers import MatlabWrapperMixin
class PsPMModel(MatlabWrapperMixin, CNBModel, ContinuousAction, ContinuousObservation):
nam... | none | 1 | 1.897877 | 2 | |
core/layouts/pixel_list.py | TheGentlemanOctopus/oracle | 0 | 11114 | from layout import Layout
class PixelList(Layout):
"""
A simple generic layout, just a list of pixels
"""
def __init__(self, pixels):
"""
pixels is a list of pixel objects
"""
self.pixels = pixels
| from layout import Layout
class PixelList(Layout):
"""
A simple generic layout, just a list of pixels
"""
def __init__(self, pixels):
"""
pixels is a list of pixel objects
"""
self.pixels = pixels
| en | 0.79331 | A simple generic layout, just a list of pixels pixels is a list of pixel objects | 3.287718 | 3 |
test/programytest/clients/restful/test_config.py | minhdc/documented-programy | 0 | 11115 | import unittest
from programy.config.file.yaml_file import YamlConfigurationFile
from programy.clients.restful.config import RestConfiguration
from programy.clients.events.console.config import ConsoleConfiguration
class RestConfigurationTests(unittest.TestCase):
def test_init(self):
yaml = YamlConfigura... | import unittest
from programy.config.file.yaml_file import YamlConfigurationFile
from programy.clients.restful.config import RestConfiguration
from programy.clients.events.console.config import ConsoleConfiguration
class RestConfigurationTests(unittest.TestCase):
def test_init(self):
yaml = YamlConfigura... | en | 0.475682 | rest: host: 127.0.0.1 port: 5000 debug: false workers: 4 use_api_keys: false api_key_file: apikeys.txt rest: | 2.469578 | 2 |
Assignments/06.py | zexhan17/Data-Structures-and-Algorithms-using-Python | 0 | 11116 | # Write a recursive function to count the number of nodes in a Tree. (first do your self then see code)
def count_nodes(self):
count = 1
left_count = 0
right_count = 0
if self.left:
left_count = self.left.count_nodes()
if self.right:
right_count = self.right.count_nodes()
return count + left_count + rig... | # Write a recursive function to count the number of nodes in a Tree. (first do your self then see code)
def count_nodes(self):
count = 1
left_count = 0
right_count = 0
if self.left:
left_count = self.left.count_nodes()
if self.right:
right_count = self.right.count_nodes()
return count + left_count + rig... | en | 0.899423 | # Write a recursive function to count the number of nodes in a Tree. (first do your self then see code) # 2: The height of a tree is the maximum number of levels in the tree. So, a tree with just one node has a height of 1. If the root has children which are leaves, the height of the tree is 2. The height of a TreeNode... | 4.310454 | 4 |
flask_app.py | mdaeron/clumpycrunch | 0 | 11117 | <filename>flask_app.py
#! /usr/bin/env python3
# from datetime import datetime
# from random import choices
# from string import ascii_lowercase
from flask import Flask, request, render_template, Response, send_file
from flaskext.markdown import Markdown
from D47crunch import D47data, pretty_table, make_csv, smart_typ... | <filename>flask_app.py
#! /usr/bin/env python3
# from datetime import datetime
# from random import choices
# from string import ascii_lowercase
from flask import Flask, request, render_template, Response, send_file
from flaskext.markdown import Markdown
from D47crunch import D47data, pretty_table, make_csv, smart_typ... | en | 0.330236 | #! /usr/bin/env python3 # from datetime import datetime # from random import choices # from string import ascii_lowercase # rcParams['backend'] = 'Agg' # rcParams['interactive'] = False UID\tSession\tSample\td45\td46\td47\tNominal_d13C_VPDB\tNominal_d18O_VPDB A01\tSession01\tETH-1\t5.795017\t11.627668\t16.893512\t2.02\... | 2.153288 | 2 |
rubric_sampling/experiments/train_rnn.py | YangAzure/rubric-sampling-public | 20 | 11118 | r"""Train a neural network to predict feedback for a program string."""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import random
import numpy as np
from tqdm import tqdm
import torch
import torch.optim as optim
import torch.utils.... | r"""Train a neural network to predict feedback for a program string."""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import random
import numpy as np
from tqdm import tqdm
import torch
import torch.optim as optim
import torch.utils.... | en | 0.746151 | Train a neural network to predict feedback for a program string. # reproducibility | 2.335166 | 2 |
python/code.py | Warabhi/ga-learner-dsmp-repo | 0 | 11119 | <filename>python/code.py
# --------------
# Code starts here
class_1 = ['<NAME>' , '<NAME>' , '<NAME>' , '<NAME>']
class_2 = ['<NAME>' , '<NAME>' , '<NAME>']
new_class = class_1 + class_2
print(new_class)
new_class.append('<NAME>')
print(new_class)
del new_class[5]
print(new_class)
# Code ends here
# --------------
#... | <filename>python/code.py
# --------------
# Code starts here
class_1 = ['<NAME>' , '<NAME>' , '<NAME>' , '<NAME>']
class_2 = ['<NAME>' , '<NAME>' , '<NAME>']
new_class = class_1 + class_2
print(new_class)
new_class.append('<NAME>')
print(new_class)
del new_class[5]
print(new_class)
# Code ends here
# --------------
#... | en | 0.41135 | # -------------- # Code starts here # Code ends here # -------------- # Code starts here # Code ends here # -------------- # Code starts here # Code ends here # -------------- # Given string # Code starts here # Code ends here | 3.923511 | 4 |
checklog.py | mtibbett67/pymodules | 0 | 11120 | <reponame>mtibbett67/pymodules<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
NAME:
checklog.py
DESCRIPTION:
This script checks the tail of the log file and lists the disk space
CREATED:
Sun Mar 15 22:53:54 2015
VERSION:
1.0
AUTHOR:
<NAME>
AUTHOR_EMAIL:
<EMAIL>
URL:
N/A
DOWNLOAD_URL:
N/A
INSTALL_... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
NAME:
checklog.py
DESCRIPTION:
This script checks the tail of the log file and lists the disk space
CREATED:
Sun Mar 15 22:53:54 2015
VERSION:
1.0
AUTHOR:
<NAME>
AUTHOR_EMAIL:
<EMAIL>
URL:
N/A
DOWNLOAD_URL:
N/A
INSTALL_REQUIRES:
[]
PACKAGES:
[]
SCRIPTS:
[]
'... | en | 0.608851 | #!/usr/bin/env python # -*- coding: utf-8 -*- NAME: checklog.py DESCRIPTION: This script checks the tail of the log file and lists the disk space CREATED: Sun Mar 15 22:53:54 2015 VERSION: 1.0 AUTHOR: <NAME> AUTHOR_EMAIL: <EMAIL> URL: N/A DOWNLOAD_URL: N/A INSTALL_REQUIRES: [] PACKAGES: [] SCRIPTS: [] # Stand... | 3.078275 | 3 |
algorithms/implementation/minimum_distances.py | avenet/hackerrank | 0 | 11121 | <filename>algorithms/implementation/minimum_distances.py
n = int(input().strip())
items = [
int(A_temp)
for A_temp
in input().strip().split(' ')
]
items_map = {}
result = None
for i, item in enumerate(items):
if item not in items_map:
items_map[item] = [i]
else:
items_map[item].ap... | <filename>algorithms/implementation/minimum_distances.py
n = int(input().strip())
items = [
int(A_temp)
for A_temp
in input().strip().split(' ')
]
items_map = {}
result = None
for i, item in enumerate(items):
if item not in items_map:
items_map[item] = [i]
else:
items_map[item].ap... | none | 1 | 3.556387 | 4 | |
spore/spore.py | pavankkota/SPoRe | 1 | 11122 | """
Sparse Poisson Recovery (SPoRe) module for solving Multiple Measurement Vector
problem with Poisson signals (MMVP) by batch stochastic gradient ascent and
Monte Carlo integration
Authors: <NAME>, <NAME>
Reference:
[1] <NAME>, <NAME>, <NAME>, and <NAME>, "Extreme Compressed
Sensing of Poisson Rates from Multip... | """
Sparse Poisson Recovery (SPoRe) module for solving Multiple Measurement Vector
problem with Poisson signals (MMVP) by batch stochastic gradient ascent and
Monte Carlo integration
Authors: <NAME>, <NAME>
Reference:
[1] <NAME>, <NAME>, <NAME>, and <NAME>, "Extreme Compressed
Sensing of Poisson Rates from Multip... | en | 0.760774 | Sparse Poisson Recovery (SPoRe) module for solving Multiple Measurement Vector problem with Poisson signals (MMVP) by batch stochastic gradient ascent and Monte Carlo integration Authors: <NAME>, <NAME> Reference: [1] <NAME>, <NAME>, <NAME>, and <NAME>, "Extreme Compressed Sensing of Poisson Rates from Multiple M... | 2.337325 | 2 |
306/translate_cds.py | jsh/pybites | 0 | 11123 | """Use translation table to translate coding sequence to protein."""
from Bio.Data import CodonTable # type: ignore
from Bio.Seq import Seq # type: ignore
def translate_cds(cds: str, translation_table: str) -> str:
"""Translate coding sequence to protein.
:param cds: str: DNA coding sequence (CDS... | """Use translation table to translate coding sequence to protein."""
from Bio.Data import CodonTable # type: ignore
from Bio.Seq import Seq # type: ignore
def translate_cds(cds: str, translation_table: str) -> str:
"""Translate coding sequence to protein.
:param cds: str: DNA coding sequence (CDS... | en | 0.590643 | Use translation table to translate coding sequence to protein. # type: ignore # type: ignore Translate coding sequence to protein.
:param cds: str: DNA coding sequence (CDS)
:param translation_table: str: translation table
as defined in Bio.Seq.Seq.CodonTable.ambiguous_generic_by_name
:return:... | 3.189839 | 3 |
example.py | n0emis/pycodimd | 1 | 11124 | <gh_stars>1-10
from pycodimd import CodiMD
cmd = CodiMD('https://md.noemis.me')
#cmd.login('<EMAIL>','CorrectHorseBatteryStaple')
cmd.load_cookies()
print(cmd.history()[-1]['text']) # Print Name of latest Note
| from pycodimd import CodiMD
cmd = CodiMD('https://md.noemis.me')
#cmd.login('<EMAIL>','CorrectHorseBatteryStaple')
cmd.load_cookies()
print(cmd.history()[-1]['text']) # Print Name of latest Note | en | 0.306834 | #cmd.login('<EMAIL>','CorrectHorseBatteryStaple') # Print Name of latest Note | 1.962529 | 2 |
PP4E-Examples-1.4/Examples/PP4E/System/Environment/echoenv.py | AngelLiang/PP4E | 0 | 11125 | <filename>PP4E-Examples-1.4/Examples/PP4E/System/Environment/echoenv.py
import os
print('echoenv...', end=' ')
print('Hello,', os.environ['USER'])
| <filename>PP4E-Examples-1.4/Examples/PP4E/System/Environment/echoenv.py
import os
print('echoenv...', end=' ')
print('Hello,', os.environ['USER'])
| none | 1 | 1.778962 | 2 | |
plix/displays.py | freelan-developers/plix | 1 | 11126 | <reponame>freelan-developers/plix
"""
Display command results.
"""
from __future__ import unicode_literals
from contextlib import contextmanager
from argparse import Namespace
from io import BytesIO
from colorama import AnsiToWin32
from chromalog.stream import stream_has_color_support
from chromalog.colorizer impor... | """
Display command results.
"""
from __future__ import unicode_literals
from contextlib import contextmanager
from argparse import Namespace
from io import BytesIO
from colorama import AnsiToWin32
from chromalog.stream import stream_has_color_support
from chromalog.colorizer import Colorizer
from chromalog.mark.he... | en | 0.853506 | Display command results. Provides general display logic to its subclasses. Contextmanager that wraps calls to :func:`start_command` and :func:`stop_command`. :param index: The index of the command. :param command: The command that is about to be executed, as an unicode string. Displ... | 2.9148 | 3 |
plugins/Autocomplete/plugin.py | mogad0n/Limnoria | 476 | 11127 | <reponame>mogad0n/Limnoria
###
# Copyright (c) 2020-2021, The Limnoria Contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above cop... | ###
# Copyright (c) 2020-2021, The Limnoria Contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this l... | en | 0.785586 | ### # Copyright (c) 2020-2021, The Limnoria Contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this l... | 1.444249 | 1 |
utils/preprocess_twitter.py | arnavk/tumblr-emotions | 0 | 11128 | """
preprocess-twitter.py
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)"
Script for preprocessing tweets by <NAME>
with small modifications by <NAME>
with translation to Python by <NAME>
Translation of Ruby script to create features for GloVe vectors for T... | """
preprocess-twitter.py
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)"
Script for preprocessing tweets by <NAME>
with small modifications by <NAME>
with translation to Python by <NAME>
Translation of Ruby script to create features for GloVe vectors for T... | en | 0.72663 | preprocess-twitter.py python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)" Script for preprocessing tweets by <NAME> with small modifications by <NAME> with translation to Python by <NAME> Translation of Ruby script to create features for GloVe vectors for Twitt... | 3.229105 | 3 |
pyPLANES/pw/pw_classes.py | matael/pyPLANES | 0 | 11129 | #! /usr/bin/env python
# -*- coding:utf8 -*-
#
# pw_classes.py
#
# This file is part of pyplanes, a software distributed under the MIT license.
# For any question, please contact one of the authors cited below.
#
# Copyright (c) 2020
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# Permission is hereby g... | #! /usr/bin/env python
# -*- coding:utf8 -*-
#
# pw_classes.py
#
# This file is part of pyplanes, a software distributed under the MIT license.
# For any question, please contact one of the authors cited below.
#
# Copyright (c) 2020
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# Permission is hereby g... | en | 0.275642 | #! /usr/bin/env python # -*- coding:utf8 -*- # # pw_classes.py # # This file is part of pyplanes, a software distributed under the MIT license. # For any question, please contact one of the authors cited below. # # Copyright (c) 2020 # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # Permission is hereby g... | 1.971944 | 2 |
mmtbx/conformation_dependent_library/mcl.py | pcxod/cctbx_project | 0 | 11130 | <reponame>pcxod/cctbx_project<filename>mmtbx/conformation_dependent_library/mcl.py
from __future__ import absolute_import, division, print_function
import sys
import time
from cctbx.array_family import flex
from scitbx.math import superpose
from mmtbx.conformation_dependent_library import mcl_sf4_coordination
from six... | from __future__ import absolute_import, division, print_function
import sys
import time
from cctbx.array_family import flex
from scitbx.math import superpose
from mmtbx.conformation_dependent_library import mcl_sf4_coordination
from six.moves import range
from mmtbx.conformation_dependent_library import metal_coordina... | en | 0.664033 | # # #'F4S' : 'S', # not done yet #'CLF' : 'Fe', # too flexible Function superpose an ideal ligand onto the mangled ligand from a ligand fitting procedure Args: ideal_hierarchy (pdb_hierarchy): Ideal ligand poor_hierarchy (pdb_hierarchy): Poor ligand with correct c.o.m. and same atom names in... | 1.907688 | 2 |
tests/test_install.py | dfroger/conda | 0 | 11131 | <gh_stars>0
from contextlib import contextmanager
import random
import shutil
import stat
import tempfile
import unittest
from os.path import join
from conda import install
from conda.install import (PaddingError, binary_replace, update_prefix,
warn_failed_remove, duplicates_to_remove)
fro... | from contextlib import contextmanager
import random
import shutil
import stat
import tempfile
import unittest
from os.path import join
from conda import install
from conda.install import (PaddingError, binary_replace, update_prefix,
warn_failed_remove, duplicates_to_remove)
from .decorator... | none | 1 | 2.460502 | 2 | |
django_elastic_appsearch/slicer.py | CorrosiveKid/django_elastic_appsearch | 11 | 11132 | <filename>django_elastic_appsearch/slicer.py<gh_stars>10-100
"""A Queryset slicer for Django."""
def slice_queryset(queryset, chunk_size):
"""Slice a queryset into chunks."""
start_pk = 0
queryset = queryset.order_by('pk')
while True:
# No entry left
if not queryset.filter(pk__gt=star... | <filename>django_elastic_appsearch/slicer.py<gh_stars>10-100
"""A Queryset slicer for Django."""
def slice_queryset(queryset, chunk_size):
"""Slice a queryset into chunks."""
start_pk = 0
queryset = queryset.order_by('pk')
while True:
# No entry left
if not queryset.filter(pk__gt=star... | en | 0.543872 | A Queryset slicer for Django. Slice a queryset into chunks. # No entry left # Fetch chunk_size entries if possible # Fetch rest entries if less than chunk_size left | 2.737046 | 3 |
newsite/news/urls.py | JasperStfun/Django_C | 0 | 11133 | <filename>newsite/news/urls.py<gh_stars>0
from django.urls import path
from . import views
urlpatterns = [
path('', views.news_home, name='news_home'),
path('create', views.create, name='create'),
path('<int:pk>', views.NewsDetailView.as_view(), name='news-detail'),
path('<int:pk>/update', views.NewsU... | <filename>newsite/news/urls.py<gh_stars>0
from django.urls import path
from . import views
urlpatterns = [
path('', views.news_home, name='news_home'),
path('create', views.create, name='create'),
path('<int:pk>', views.NewsDetailView.as_view(), name='news-detail'),
path('<int:pk>/update', views.NewsU... | none | 1 | 1.835312 | 2 | |
module/phase_one/headers.py | cqr-cryeye-forks/Florid | 7 | 11134 | <reponame>cqr-cryeye-forks/Florid<filename>module/phase_one/headers.py
import requests
import lib.common
MODULE_NAME = 'headers'
def run():
r = requests.get(lib.common.SOURCE_URL)
# X-Forwarded-By:
if 'X-Powered-By' in r.headers:
lib.common.RESULT_ONE_DICT['X-Powered-By'] = r.headers['X-Powered... | import requests
import lib.common
MODULE_NAME = 'headers'
def run():
r = requests.get(lib.common.SOURCE_URL)
# X-Forwarded-By:
if 'X-Powered-By' in r.headers:
lib.common.RESULT_ONE_DICT['X-Powered-By'] = r.headers['X-Powered-By']
# Server:
if 'Server' in r.headers:
lib.common.R... | en | 0.592287 | # X-Forwarded-By: # Server: | 2.523036 | 3 |
ekorpkit/io/fetch/edgar/edgar.py | entelecheia/ekorpkit | 4 | 11135 | import os
import requests
from bs4 import BeautifulSoup
from ekorpkit import eKonf
from ekorpkit.io.download.web import web_download, web_download_unzip
class EDGAR:
def __init__(self, **args):
self.args = eKonf.to_config(args)
self.base_url = self.args.base_url
self.url = self.args.url
... | import os
import requests
from bs4 import BeautifulSoup
from ekorpkit import eKonf
from ekorpkit.io.download.web import web_download, web_download_unzip
class EDGAR:
def __init__(self, **args):
self.args = eKonf.to_config(args)
self.base_url = self.args.base_url
self.url = self.args.url
... | none | 1 | 2.869525 | 3 | |
HARK/ConsumptionSaving/tests/test_PerfForesightConsumerType.py | michiboo/HARK | 0 | 11136 | from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType
import numpy as np
import unittest
class testPerfForesightConsumerType(unittest.TestCase):
def setUp(self):
self.agent = PerfForesightConsumerType()
self.agent_infinite = PerfForesightConsumerType(cycles=0)
PF_... | from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType
import numpy as np
import unittest
class testPerfForesightConsumerType(unittest.TestCase):
def setUp(self):
self.agent = PerfForesightConsumerType()
self.agent_infinite = PerfForesightConsumerType(cycles=0)
PF_... | en | 0.748397 | # Create parameter values necessary for simulation # Number of agents of this type # Number of periods to simulate # Mean of log initial assets # Standard deviation of log initial assets # Mean of log initial permanent income # Standard deviation of log initial permanent income # Aggregate permanent income growth facto... | 2.289045 | 2 |
src-gen/openapi_server/models/config.py | etherisc/bima-bolt-api | 0 | 11137 | <filename>src-gen/openapi_server/models/config.py
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server.models.component import Component
from openapi... | <filename>src-gen/openapi_server/models/config.py
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server.models.component import Component
from openapi... | en | 0.49713 | # coding: utf-8 # noqa: F401 # noqa: F401 # noqa: E501 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. # noqa: E501 Config - a model defined in OpenAPI :param mongo: The mongo of this Config. # noqa: E501 :type mongo: Compo... | 2.227964 | 2 |
txt_annotation.py | bubbliiiing/classification-keras | 30 | 11138 | import os
from os import getcwd
#---------------------------------------------#
# 训练前一定要注意修改classes
# 种类顺序需要和model_data下的txt一样
#---------------------------------------------#
classes = ["cat", "dog"]
sets = ["train", "test"]
wd = getcwd()
for se in sets:
list_file = open('cls_' + se + '.txt', 'w')... | import os
from os import getcwd
#---------------------------------------------#
# 训练前一定要注意修改classes
# 种类顺序需要和model_data下的txt一样
#---------------------------------------------#
classes = ["cat", "dog"]
sets = ["train", "test"]
wd = getcwd()
for se in sets:
list_file = open('cls_' + se + '.txt', 'w')... | zh | 0.170586 | #---------------------------------------------# # 训练前一定要注意修改classes # 种类顺序需要和model_data下的txt一样 #---------------------------------------------# | 2.684279 | 3 |
S4/S4 Library/simulation/relationships/sim_knowledge.py | NeonOcean/Environment | 1 | 11139 | <filename>S4/S4 Library/simulation/relationships/sim_knowledge.py
from protocolbuffers import SimObjectAttributes_pb2 as protocols
from careers.career_unemployment import CareerUnemployment
import services
import sims4
logger = sims4.log.Logger('Relationship', default_owner='jjacobson')
class SimKnowledge:
__slots... | <filename>S4/S4 Library/simulation/relationships/sim_knowledge.py
from protocolbuffers import SimObjectAttributes_pb2 as protocols
from careers.career_unemployment import CareerUnemployment
import services
import sims4
logger = sims4.log.Logger('Relationship', default_owner='jjacobson')
class SimKnowledge:
__slots... | none | 1 | 2.38683 | 2 | |
233_number_of_digt_one.py | gengwg/leetcode | 2 | 11140 | <gh_stars>1-10
# Given an integer n, count the total number of digit 1 appearing
# in all non-negative integers less than or equal to n.
#
# For example:
# Given n = 13,
# Return 6, because digit 1 occurred in the following numbers:
# 1, 10, 11, 12, 13.
#
class Solution:
def countDigitOne(self, n):
"""
... | # Given an integer n, count the total number of digit 1 appearing
# in all non-negative integers less than or equal to n.
#
# For example:
# Given n = 13,
# Return 6, because digit 1 occurred in the following numbers:
# 1, 10, 11, 12, 13.
#
class Solution:
def countDigitOne(self, n):
"""
:type n: ... | en | 0.784761 | # Given an integer n, count the total number of digit 1 appearing # in all non-negative integers less than or equal to n. # # For example: # Given n = 13, # Return 6, because digit 1 occurred in the following numbers: # 1, 10, 11, 12, 13. # :type n: int :rtype: int # sum all the '1's inside the n numbers # cou... | 3.993073 | 4 |
Search Algorithms.py | fzehracetin/A-Star-and-Best-First-Search | 1 | 11141 | from PIL import Image
from math import sqrt
import numpy as np
import time
import matplotlib.backends.backend_tkagg
import matplotlib.pyplot as plt
class Point:
x: float
y: float
f: float
h: float
g: float
def __init__(self, x, y, f):
self.x = x
self.y = y
... | from PIL import Image
from math import sqrt
import numpy as np
import time
import matplotlib.backends.backend_tkagg
import matplotlib.pyplot as plt
class Point:
x: float
y: float
f: float
h: float
g: float
def __init__(self, x, y, f):
self.x = x
self.y = y
... | en | 0.370123 | # swap # a_star # bfs'de g = 0 # stack # heap # print(point.x, point.y) # print("first if") # print("nd if") # print("3rd if") # print("4th if") # image.show() print("--------------YOL------------------")
for i in range(len(yol)):
print("x: {}, y:{}, distance:{}".format(yol[i].x, yol[i].y, yol[i].f))
... | 3.181326 | 3 |
time_test.py | Shb742/rnnoise_python | 32 | 11142 | #Author <NAME>
import time
import rnnoise
import numpy as np
def time_rnnoise(rounds=1000):
a = rnnoise.RNNoise()
timer = 0.0
st = time.time()
for i in range(rounds):
inp = np.random.bytes(960)
timer = (time.time() - st)
print(timer)
st = time.time()
for i in range(rounds):
inp = np.random.bytes(960)
va,o... | #Author <NAME>
import time
import rnnoise
import numpy as np
def time_rnnoise(rounds=1000):
a = rnnoise.RNNoise()
timer = 0.0
st = time.time()
for i in range(rounds):
inp = np.random.bytes(960)
timer = (time.time() - st)
print(timer)
st = time.time()
for i in range(rounds):
inp = np.random.bytes(960)
va,o... | en | 0.748841 | #Author <NAME> | 2.881959 | 3 |
tests/test_shell.py | jakubtyniecki/pact | 2 | 11143 |
""" shell sort tests module """
import unittest
import random
from sort import shell
from tests import helper
class ShellSortTests(unittest.TestCase):
""" shell sort unit tests class """
max = 100
arr = []
def setUp(self):
""" setting up for the test """
self.arr = random.sample(ran... |
""" shell sort tests module """
import unittest
import random
from sort import shell
from tests import helper
class ShellSortTests(unittest.TestCase):
""" shell sort unit tests class """
max = 100
arr = []
def setUp(self):
""" setting up for the test """
self.arr = random.sample(ran... | en | 0.66479 | shell sort tests module shell sort unit tests class setting up for the test should raise when input array is None # arrange # act # assert should return [] when input array is empty # arrange # act # assert should sort a given array # act # assert | 3.617759 | 4 |
k8s_apps/admin/dump_inventory_file.py | AkadioInc/firefly | 0 | 11144 | <filename>k8s_apps/admin/dump_inventory_file.py<gh_stars>0
import h5pyd
from datetime import datetime
import tzlocal
BUCKET="firefly-hsds"
inventory_domain = "/FIREfly/inventory.h5"
def formatTime(timestamp):
local_timezone = tzlocal.get_localzone() # get pytz timezone
local_time = datetime.fromtimestamp(time... | <filename>k8s_apps/admin/dump_inventory_file.py<gh_stars>0
import h5pyd
from datetime import datetime
import tzlocal
BUCKET="firefly-hsds"
inventory_domain = "/FIREfly/inventory.h5"
def formatTime(timestamp):
local_timezone = tzlocal.get_localzone() # get pytz timezone
local_time = datetime.fromtimestamp(time... | en | 0.145517 | # get pytz timezone | 2.483593 | 2 |
enaml/qt/qt_timer.py | xtuzy/enaml | 1,080 | 11145 | <reponame>xtuzy/enaml
#------------------------------------------------------------------------------
# Copyright (c) 2013-2017, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#--------------------------... | #------------------------------------------------------------------------------
# Copyright (c) 2013-2017, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------... | en | 0.355919 | #------------------------------------------------------------------------------ # Copyright (c) 2013-2017, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. #------------------------------------------------... | 2.001926 | 2 |
mindhome_alpha/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py | Mindhome/field_service | 1 | 11146 | <filename>mindhome_alpha/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
from json import dumps
import frappe
import unittest
from erpnext.erp... | <filename>mindhome_alpha/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
from json import dumps
import frappe
import unittest
from erpnext.erp... | en | 0.907149 | # -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt # test integration request creation and successful update of the status on receiving callback response # test formatting of account balance received as string to json with appropriate currency symbol # test pa... | 1.716763 | 2 |
b2accessdeprovisioning/configparser.py | EUDAT-B2ACCESS/b2access-deprovisioning-report | 0 | 11147 | <reponame>EUDAT-B2ACCESS/b2access-deprovisioning-report<filename>b2accessdeprovisioning/configparser.py
from __future__ import absolute_import
import yaml
with open("config.yml", "r") as f:
config = yaml.load(f)
| from __future__ import absolute_import
import yaml
with open("config.yml", "r") as f:
config = yaml.load(f) | none | 1 | 1.64323 | 2 | |
res_mods/mods/packages/xvm_main/python/vehinfo_tiers.py | peterbartha/ImmunoMod | 0 | 11148 | <reponame>peterbartha/ImmunoMod<filename>res_mods/mods/packages/xvm_main/python/vehinfo_tiers.py
""" XVM (c) www.modxvm.com 2013-2017 """
# PUBLIC
def getTiers(level, cls, key):
return _getTiers(level, cls, key)
# PRIVATE
from logger import *
from gui.shared.utils.requesters import REQ_CRITERIA
from helpers im... | """ XVM (c) www.modxvm.com 2013-2017 """
# PUBLIC
def getTiers(level, cls, key):
return _getTiers(level, cls, key)
# PRIVATE
from logger import *
from gui.shared.utils.requesters import REQ_CRITERIA
from helpers import dependency
from skeletons.gui.shared import IItemsCache
_special = {
# Data from http:/... | en | 0.208373 | XVM (c) www.modxvm.com 2013-2017 # PUBLIC # PRIVATE # Data from http://forum.worldoftanks.ru/index.php?/topic/41221- # Last update: 23.05.2017 # level 2 # level 3 # level 4 # level 5 # level 6 # level 7 # level 8 # HT: (=T4 max+1) # default: (<T3 max+1) & (>=T3 max+2) & (>T9 max=11) | 2.048966 | 2 |
pypy/module/cpyext/test/test_pystrtod.py | m4sterchain/mesapy | 381 | 11149 | <filename>pypy/module/cpyext/test/test_pystrtod.py
import math
from pypy.module.cpyext import pystrtod
from pypy.module.cpyext.test.test_api import BaseApiTest, raises_w
from rpython.rtyper.lltypesystem import rffi
from rpython.rtyper.lltypesystem import lltype
from pypy.module.cpyext.pystrtod import PyOS_string_to_do... | <filename>pypy/module/cpyext/test/test_pystrtod.py
import math
from pypy.module.cpyext import pystrtod
from pypy.module.cpyext.test.test_api import BaseApiTest, raises_w
from rpython.rtyper.lltypesystem import rffi
from rpython.rtyper.lltypesystem import lltype
from pypy.module.cpyext.pystrtod import PyOS_string_to_do... | none | 1 | 2.209617 | 2 | |
mathics/core/systemsymbols.py | Mathics3/mathics-core | 90 | 11150 | <gh_stars>10-100
# -*- coding: utf-8 -*-
from mathics.core.symbols import Symbol
# Some other common Symbols. This list is sorted in alphabetic order.
SymbolAssumptions = Symbol("$Assumptions")
SymbolAborted = Symbol("$Aborted")
SymbolAll = Symbol("All")
SymbolAlternatives = Symbol("Alternatives")
SymbolAnd = Symbol(... | # -*- coding: utf-8 -*-
from mathics.core.symbols import Symbol
# Some other common Symbols. This list is sorted in alphabetic order.
SymbolAssumptions = Symbol("$Assumptions")
SymbolAborted = Symbol("$Aborted")
SymbolAll = Symbol("All")
SymbolAlternatives = Symbol("Alternatives")
SymbolAnd = Symbol("And")
SymbolAppe... | en | 0.881221 | # -*- coding: utf-8 -*- # Some other common Symbols. This list is sorted in alphabetic order. | 2.393945 | 2 |
exercises/ali/cartpole-MCTS/cartpole.py | alik604/ra | 0 | 11151 | # from https://github.com/kvwoerden/mcts-cartpole
# ---------------------------------------------------------------------------- #
# Imports #
# ---------------------------------------------------------------------------- #
import os
import time
impor... | # from https://github.com/kvwoerden/mcts-cartpole
# ---------------------------------------------------------------------------- #
# Imports #
# ---------------------------------------------------------------------------- #
import os
import time
impor... | en | 0.44 | # from https://github.com/kvwoerden/mcts-cartpole # ---------------------------------------------------------------------------- # # Imports # # ---------------------------------------------------------------------------- # # -------------------------... | 1.982043 | 2 |
wildlifecompliance/components/applications/cron.py | preranaandure/wildlifecompliance | 1 | 11152 | from django_cron import CronJobBase, Schedule
class VerifyLicenceSpeciesJob(CronJobBase):
"""
Verifies LicenceSpecies against TSC server.
"""
RUN_AT_TIMES = ['00:00']
schedule = Schedule(run_at_times=RUN_AT_TIMES)
code = 'applications.verify_licence_species'
def do(self):
pass
| from django_cron import CronJobBase, Schedule
class VerifyLicenceSpeciesJob(CronJobBase):
"""
Verifies LicenceSpecies against TSC server.
"""
RUN_AT_TIMES = ['00:00']
schedule = Schedule(run_at_times=RUN_AT_TIMES)
code = 'applications.verify_licence_species'
def do(self):
pass
| en | 0.879098 | Verifies LicenceSpecies against TSC server. | 2.048071 | 2 |
optional-plugins/CSVPlugin/CSVContext.py | owlfish/pubtal | 0 | 11153 | import ASV
from simpletal import simpleTAL, simpleTALES
try:
import logging
except:
import InfoLogging as logging
import codecs
class ColumnSorter:
def __init__ (self, columnList):
self.columnList = columnList
self.log = logging.getLogger ('ColumnSorter')
def setup (self, fieldNames):
mapList = []
fo... | import ASV
from simpletal import simpleTAL, simpleTALES
try:
import logging
except:
import InfoLogging as logging
import codecs
class ColumnSorter:
def __init__ (self, columnList):
self.columnList = columnList
self.log = logging.getLogger ('ColumnSorter')
def setup (self, fieldNames):
mapList = []
fo... | none | 1 | 2.827462 | 3 | |
wagtail/admin/forms/comments.py | stephiescastle/wagtail | 0 | 11154 | <reponame>stephiescastle/wagtail<gh_stars>0
from django.forms import BooleanField, ValidationError
from django.utils.timezone import now
from django.utils.translation import gettext as _
from .models import WagtailAdminModelForm
class CommentReplyForm(WagtailAdminModelForm):
class Meta:
fields = ("text",... | from django.forms import BooleanField, ValidationError
from django.utils.timezone import now
from django.utils.translation import gettext as _
from .models import WagtailAdminModelForm
class CommentReplyForm(WagtailAdminModelForm):
class Meta:
fields = ("text",)
def clean(self):
cleaned_data... | en | 0.941113 | # trying to edit someone else's comment reply # includes DELETION_FIELD_NAME, as users cannot delete each other's individual comment replies # if deleting a whole thread, this should be done by deleting the parent Comment instead This is designed to be subclassed and have the user overridden to enable user-based valida... | 2.139666 | 2 |
run_db_data.py | MahirMahbub/email-client | 0 | 11155 | <filename>run_db_data.py
import os
from sqlalchemy.orm import Session
from db.database import SessionLocal
class DbData:
def __init__(self):
self.root_directory: str = "db_merge_scripts"
self.scripts = [
"loader.sql"
]
def sync(self, db: Session):
for script in s... | <filename>run_db_data.py
import os
from sqlalchemy.orm import Session
from db.database import SessionLocal
class DbData:
def __init__(self):
self.root_directory: str = "db_merge_scripts"
self.scripts = [
"loader.sql"
]
def sync(self, db: Session):
for script in s... | none | 1 | 2.642968 | 3 | |
scobra/analysis/compare_elements.py | nihalzp/scobra | 7 | 11156 |
def compareMetaboliteDicts(d1, d2):
sorted_d1_keys = sorted(d1.keys())
sorted_d2_keys = sorted(d2.keys())
for i in range(len(sorted_d1_keys)):
if not compareMetabolites(sorted_d1_keys[i], sorted_d2_keys[i], naive=True):
return False
elif not d1[sorted_d1_keys[i]] == d2[sorted_... |
def compareMetaboliteDicts(d1, d2):
sorted_d1_keys = sorted(d1.keys())
sorted_d2_keys = sorted(d2.keys())
for i in range(len(sorted_d1_keys)):
if not compareMetabolites(sorted_d1_keys[i], sorted_d2_keys[i], naive=True):
return False
elif not d1[sorted_d1_keys[i]] == d2[sorted_... | en | 0.443113 | #can never be entered #elif not met1.annotation == met2.annotation: # return False #elif not met1.notes == met2.notes: # return False #can never be entered #elif not r1._compartments == r2._compartments: # return False #elif not r1._forward_variable == r2._forward_variable: # return False #elif not r1._mode... | 2.598148 | 3 |
five/five_copy.py | ngd-b/python-demo | 1 | 11157 | <filename>five/five_copy.py<gh_stars>1-10
#!/usr/bin/python
# -*- coding:utf-8 -*-
print("hello world")
f = None
try:
f = open("./hello.txt","r",encoding="utf8")
print(f.read(5),end='')
print(f.read(5),end='')
print(f.read(5))
except IOError as e:
print(e)
finally:
if f:
f.close()
# w... | <filename>five/five_copy.py<gh_stars>1-10
#!/usr/bin/python
# -*- coding:utf-8 -*-
print("hello world")
f = None
try:
f = open("./hello.txt","r",encoding="utf8")
print(f.read(5),end='')
print(f.read(5),end='')
print(f.read(5))
except IOError as e:
print(e)
finally:
if f:
f.close()
# w... | zh | 0.768632 | #!/usr/bin/python # -*- coding:utf-8 -*- # with auto call the methods' close # readlines() 按行读取文件 # 写入数据 # StringIO / BytesIO # 创建 # 读取初始化进去的值 # 写入 # 获取 while True: s = str.readline() if s == '': break print(s.strip()) # 写入二进制数据 # 操作系统文件目录 OS # 当前环境 nt # python 执行文件 <module 'ntpath' from 'G:\\py... | 3.526789 | 4 |
prepare_sets.py | mechtal/Vaccination_UK | 0 | 11158 | def prepare_sets(dataset, feature_columns, y_column):
train_X, val_X, train_y, val_y = train_test_split(dataset[feature_columns], dataset[y_column], random_state=1)
return train_X, val_X, train_y, val_y | def prepare_sets(dataset, feature_columns, y_column):
train_X, val_X, train_y, val_y = train_test_split(dataset[feature_columns], dataset[y_column], random_state=1)
return train_X, val_X, train_y, val_y | none | 1 | 2.418004 | 2 | |
examples/batch_ts_insert.py | bureau14/qdb-api-python | 9 | 11159 | # Copyright (c) 2009-2020, quasardb SAS. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice,... | # Copyright (c) 2009-2020, quasardb SAS. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice,... | en | 0.739644 | # Copyright (c) 2009-2020, quasardb SAS. All rights reserved. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright # notice,... | 1.536539 | 2 |
tests/backends/test_flashtext_backend.py | openredact/pii-identifier | 14 | 11160 | from nerwhal.backends.flashtext_backend import FlashtextBackend
from nerwhal.recognizer_bases import FlashtextRecognizer
def test_single_recognizer(embed):
class TestRecognizer(FlashtextRecognizer):
TAG = "XX"
SCORE = 1.0
@property
def keywords(self):
return ["abc", "c... | from nerwhal.backends.flashtext_backend import FlashtextBackend
from nerwhal.recognizer_bases import FlashtextRecognizer
def test_single_recognizer(embed):
class TestRecognizer(FlashtextRecognizer):
TAG = "XX"
SCORE = 1.0
@property
def keywords(self):
return ["abc", "c... | en | 0.513329 | # Recognizer B overwrites the keyword "cde" | 2.50629 | 3 |
new_rdsmysql.py | AdminTurnedDevOps/AWS_Solutions_Architect_Python | 30 | 11161 | import boto3
import sys
import time
import logging
import getpass
def new_rdsmysql(dbname, instanceID, storage, dbInstancetype, dbusername):
masterPass = getpass.getpass('DBMasterPassword: ')
if len(masterPass) < 10:
logging.warning('Password is not at least 10 characters. Please try again')
... | import boto3
import sys
import time
import logging
import getpass
def new_rdsmysql(dbname, instanceID, storage, dbInstancetype, dbusername):
masterPass = getpass.getpass('DBMasterPassword: ')
if len(masterPass) < 10:
logging.warning('Password is not at least 10 characters. Please try again')
... | none | 1 | 2.574126 | 3 | |
src/tzscan/tzscan_block_api.py | Twente-Mining/tezos-reward-distributor | 0 | 11162 | <gh_stars>0
import random
import requests
from api.block_api import BlockApi
from exception.tzscan import TzScanException
from log_config import main_logger
logger = main_logger
HEAD_API = {'MAINNET': {'HEAD_API_URL': 'https://api%MIRROR%.tzscan.io/v2/head'},
'ALPHANET': {'HEAD_API_URL': 'http://api.alp... | import random
import requests
from api.block_api import BlockApi
from exception.tzscan import TzScanException
from log_config import main_logger
logger = main_logger
HEAD_API = {'MAINNET': {'HEAD_API_URL': 'https://api%MIRROR%.tzscan.io/v2/head'},
'ALPHANET': {'HEAD_API_URL': 'http://api.alphanet.tzscan... | en | 0.998087 | # This means something went wrong. # This means something went wrong. # has problem lately | 2.44303 | 2 |
python/cuxfilter/tests/charts/core/test_core_non_aggregate.py | Anhmike/cuxfilter | 201 | 11163 | import pytest
import cudf
import mock
from cuxfilter.charts.core.non_aggregate.core_non_aggregate import (
BaseNonAggregate,
)
from cuxfilter.dashboard import DashBoard
from cuxfilter import DataFrame
from cuxfilter.layouts import chart_view
class TestCoreNonAggregateChart:
def test_variables(self):
... | import pytest
import cudf
import mock
from cuxfilter.charts.core.non_aggregate.core_non_aggregate import (
BaseNonAggregate,
)
from cuxfilter.dashboard import DashBoard
from cuxfilter import DataFrame
from cuxfilter.layouts import chart_view
class TestCoreNonAggregateChart:
def test_variables(self):
... | en | 0.892221 | # BaseChart variables # test chart name setter # BaseNonAggregateChart variables Calculate source just calls to the format_source_data function which is implemented by chart types inheriting this class. # creating a dummy reload chart fn as its not implemented in core # non aggregate chart class # creating a du... | 2.086071 | 2 |
tunobase/tagging/migrations/0001_initial.py | unomena/tunobase-core | 0 | 11164 | <gh_stars>0
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Tag'
db.create_table(u'tagging_tag', (
... | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Tag'
db.create_table(u'tagging_tag', (
(u'id'... | en | 0.543759 | # -*- coding: utf-8 -*- # Adding model 'Tag' # Adding unique constraint on 'Tag', fields ['title', 'site'] # Adding model 'ContentObjectTag' # Removing unique constraint on 'Tag', fields ['title', 'site'] # Deleting model 'Tag' # Deleting model 'ContentObjectTag' | 2.205528 | 2 |
recogym/envs/session.py | philomenec/reco-gym | 413 | 11165 | <reponame>philomenec/reco-gym
class Session(list):
"""Abstract Session class"""
def to_strings(self, user_id, session_id):
"""represent session as list of strings (one per event)"""
user_id, session_id = str(user_id), str(session_id)
session_type = self.get_type()
strings = []
... | class Session(list):
"""Abstract Session class"""
def to_strings(self, user_id, session_id):
"""represent session as list of strings (one per event)"""
user_id, session_id = str(user_id), str(session_id)
session_type = self.get_type()
strings = []
for event, product in s... | en | 0.918428 | Abstract Session class represent session as list of strings (one per event) | 3.183681 | 3 |
message_handlers/location_handler.py | pratyushmore/lunch-tag-bot | 0 | 11166 | def location(messaging_adaptor, user, channel, location):
message = "Your location has been set to `{}`. You are ready to be matched for Lunch Tag :)".format(location)
messaging_adaptor.send_message(channel, message)
| def location(messaging_adaptor, user, channel, location):
message = "Your location has been set to `{}`. You are ready to be matched for Lunch Tag :)".format(location)
messaging_adaptor.send_message(channel, message)
| none | 1 | 2.385355 | 2 | |
b.py | lbarchive/b.py | 0 | 11167 | <gh_stars>0
#!/usr/bin/env python
# Copyright (C) 2013-2016 by <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, ... | #!/usr/bin/env python
# Copyright (C) 2013-2016 by <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | en | 0.673321 | #!/usr/bin/env python # Copyright (C) 2013-2016 by <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify... | 1.377295 | 1 |
spyder/plugins/outlineexplorer/api.py | suokunlong/spyder | 1 | 11168 | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Outline explorer API.
You need to declare a OutlineExplorerProxy, and a function for handle the
edit_goto Signal.
class OutlineExplorerProxyCustom(OutlineExplore... | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Outline explorer API.
You need to declare a OutlineExplorerProxy, and a function for handle the
edit_goto Signal.
class OutlineExplorerProxyCustom(OutlineExplore... | en | 0.714795 | # -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) Outline explorer API. You need to declare a OutlineExplorerProxy, and a function for handle the edit_goto Signal. class OutlineExplorerProxyCustom(OutlineExplorerPro... | 2.505699 | 3 |
seamless/core/__init__.py | sjdv1982/seamless | 15 | 11169 | <filename>seamless/core/__init__.py
import weakref
class IpyString(str):
def _repr_pretty_(self, p, cycle):
return p.text(str(self))
class SeamlessBase:
_destroyed = False
_context = None
_cached_path = None
name = None
def _get_macro(self):
return self._context()._macro
@... | <filename>seamless/core/__init__.py
import weakref
class IpyString(str):
def _repr_pretty_(self, p, cycle):
return p.text(str(self))
class SeamlessBase:
_destroyed = False
_context = None
_cached_path = None
name = None
def _get_macro(self):
return self._context()._macro
@... | en | 0.967011 | #worker/cell must have a context #worker/cell must have a context | 2.194475 | 2 |
oguilem/configuration/config.py | dewberryants/oGUIlem | 2 | 11170 | import os
import re
import sys
from oguilem.configuration.fitness import OGUILEMFitnessFunctionConfiguration
from oguilem.configuration.ga import OGUILEMGlobOptConfig
from oguilem.configuration.geometry import OGUILEMGeometryConfig
from oguilem.configuration.utils import ConnectedValue, ConfigFileManager
from oguilem.... | import os
import re
import sys
from oguilem.configuration.fitness import OGUILEMFitnessFunctionConfiguration
from oguilem.configuration.ga import OGUILEMGlobOptConfig
from oguilem.configuration.geometry import OGUILEMGeometryConfig
from oguilem.configuration.utils import ConnectedValue, ConfigFileManager
from oguilem.... | en | 0.761416 | ##OGOLEM###\n" # Find geometry block and split off # Separate off blocks # Charge and Spin Blocks # Geometry Block # Any Backend Definitions # Parse them # Deal with the rest | 2.099128 | 2 |
xpd_workflow/temp_graph.py | CJ-Wright/xpd_workflow | 0 | 11171 | <filename>xpd_workflow/temp_graph.py
from __future__ import (division, print_function)
import matplotlib.cm as cmx
import matplotlib.colors as colors
from matplotlib import gridspec
from metadatastore.api import db_connect as mds_db_connect
from filestore.api import db_connect as fs_db_connect
fs_db_connect(
**{... | <filename>xpd_workflow/temp_graph.py
from __future__ import (division, print_function)
import matplotlib.cm as cmx
import matplotlib.colors as colors
from matplotlib import gridspec
from metadatastore.api import db_connect as mds_db_connect
from filestore.api import db_connect as fs_db_connect
fs_db_connect(
**{... | en | 0.343087 | # Standard reflections for sample components #97-008-1577.txt') # 'NiO', # 'Pr4' # niox_hkl, # pr4_hkl # niox_tth, # pr4_tth # 'red', # 18, 20, 22, 16, 28, 29, 27, 26 # ns = [26] # # key_list = [f for f in os.listdir(folder) if # f.endswith('.gr') and not f.startswith('d')] # key_list2.sort() # ax1.grid(Tru... | 1.993017 | 2 |
winnow/core.py | bgschiller/winnow | 3 | 11172 | from __future__ import unicode_literals
import copy
import json
from six import string_types
from . import default_operators
from . import sql_prepare
from . import values
from .error import WinnowError
from .templating import SqlFragment
from .templating import WinnowSql
class Winnow(object):
"""
Winnow is... | from __future__ import unicode_literals
import copy
import json
from six import string_types
from . import default_operators
from . import sql_prepare
from . import values
from .error import WinnowError
from .templating import SqlFragment
from .templating import WinnowSql
class Winnow(object):
"""
Winnow is... | en | 0.827692 | Winnow is a SQL query builder specifically designed for powerful filtering on a table. It is designed to be efficient and low-magic. # Take care here -- In order to avoid mucking up the parent's copy of this # static value we have to deep copy it to every subclass. Proxy to self.sql Given a filter, resolve (e... | 2.351902 | 2 |
ibis/bigquery/client.py | tswast/ibis | 0 | 11173 | import regex as re
import time
import collections
import datetime
import six
import pandas as pd
import google.cloud.bigquery as bq
from multipledispatch import Dispatcher
import ibis
import ibis.common as com
import ibis.expr.operations as ops
import ibis.expr.types as ir
import ibis.expr.schema as sch
import ibis... | import regex as re
import time
import collections
import datetime
import six
import pandas as pd
import google.cloud.bigquery as bq
from multipledispatch import Dispatcher
import ibis
import ibis.common as com
import ibis.expr.operations as ops
import ibis.expr.types as ir
import ibis.expr.schema as sch
import ibis... | en | 0.679299 | # FIXME: enforce no tz info Cursor to allow the BigQuery client to reuse machinery in ibis/client.py # For compatibility when constructed from Query.execute() :func:`~ibis.expr.lineage.traverse` function to find all :class:`~ibis.expr.types.ScalarParameter` instances and yield the operation and the parent expre... | 1.989636 | 2 |
5 kyu/Family Tree Ancestors.py | mwk0408/codewars_solutions | 6 | 11174 | <filename>5 kyu/Family Tree Ancestors.py<gh_stars>1-10
from math import log, ceil
def chart(person):
res=helper(tuple(sorted(person.parents(), key=lambda x: x.sex, reverse=True)), 2, [], 16, 16)
res.append((person.name, 16))
dict={j:i for i,j in res}
dict2=helper2(16)
chart=[]
for i in range(1,... | <filename>5 kyu/Family Tree Ancestors.py<gh_stars>1-10
from math import log, ceil
def chart(person):
res=helper(tuple(sorted(person.parents(), key=lambda x: x.sex, reverse=True)), 2, [], 16, 16)
res.append((person.name, 16))
dict={j:i for i,j in res}
dict2=helper2(16)
chart=[]
for i in range(1,... | none | 1 | 3.03023 | 3 | |
tests/make_expected_lookup.py | bfis/coffea | 77 | 11175 | import numpy as np
import ROOT
from dummy_distributions import dummy_pt_eta
counts, test_in1, test_in2 = dummy_pt_eta()
f = ROOT.TFile.Open("samples/testSF2d.root")
sf = f.Get("scalefactors_Tight_Electron")
xmin, xmax = sf.GetXaxis().GetXmin(), sf.GetXaxis().GetXmax()
ymin, ymax = sf.GetYaxis().GetXmin(), sf.GetYax... | import numpy as np
import ROOT
from dummy_distributions import dummy_pt_eta
counts, test_in1, test_in2 = dummy_pt_eta()
f = ROOT.TFile.Open("samples/testSF2d.root")
sf = f.Get("scalefactors_Tight_Electron")
xmin, xmax = sf.GetXaxis().GetXmin(), sf.GetXaxis().GetXmax()
ymin, ymax = sf.GetYaxis().GetXmin(), sf.GetYax... | none | 1 | 1.852014 | 2 | |
engine/sentiment_analysis.py | zgeorg03/nesase | 2 | 11176 | <filename>engine/sentiment_analysis.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 14 17:42:27 2018
@author: zgeorg03
"""
import re
import json # Used for converting json to dictionary
import datetime # Used for date conversions
import matplotlib.pyplot as plt
import numpy as np
from sentim... | <filename>engine/sentiment_analysis.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 14 17:42:27 2018
@author: zgeorg03
"""
import re
import json # Used for converting json to dictionary
import datetime # Used for date conversions
import matplotlib.pyplot as plt
import numpy as np
from sentim... | en | 0.551692 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Mar 14 17:42:27 2018 @author: zgeorg03 # Used for converting json to dictionary # Used for date conversions #max_articles = 1000 | 2.754128 | 3 |
ch05/recursion.py | laszlokiraly/LearningAlgorithms | 74 | 11177 | """Recursive implementations."""
def find_max(A):
"""invoke recursive function to find maximum value in A."""
def rmax(lo, hi):
"""Use recursion to find maximum value in A[lo:hi+1]."""
if lo == hi: return A[lo]
mid = (lo+hi) // 2
L = rmax(lo, mid)
R = rmax(mid+1, hi)
... | """Recursive implementations."""
def find_max(A):
"""invoke recursive function to find maximum value in A."""
def rmax(lo, hi):
"""Use recursion to find maximum value in A[lo:hi+1]."""
if lo == hi: return A[lo]
mid = (lo+hi) // 2
L = rmax(lo, mid)
R = rmax(mid+1, hi)
... | en | 0.626009 | Recursive implementations. invoke recursive function to find maximum value in A. Use recursion to find maximum value in A[lo:hi+1]. Count number of comparisons. Use recursion to find maximum value in A[lo:hi+1] incl. count invoke recursive function to return number of times target appears in A. Use recursion to find ma... | 4.046809 | 4 |
setup.py | koonimaru/DeepGMAP | 11 | 11178 | #from distutils.core import setup
from setuptools import setup, find_packages
from distutils.extension import Extension
import re
import os
import codecs
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pyp... | #from distutils.core import setup
from setuptools import setup, find_packages
from distutils.extension import Extension
import re
import os
import codecs
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pyp... | en | 0.408058 | #from distutils.core import setup # intentionally *not* adding an encoding option to open, See: # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 #Extension("data_preprocessing_tools.queue", [ "deepgmap/data_preprocessing_tools/queue.pyx" ],libraries=["calg"]), #print(find_version("deepgmap", "__in... | 1.964374 | 2 |
{{cookiecutter.project_slug}}/api/__init__.py | Steamboat/cookiecutter-devops | 0 | 11179 |
import logging
from flask import Flask
from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
from flask_talisman import Talisman
from flask_ipban import IpBan
from config import Config, get_logger_handler
# database
class SQLAlchemy(_BaseSQLAlchemy):... |
import logging
from flask import Flask
from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
from flask_talisman import Talisman
from flask_ipban import IpBan
from config import Config, get_logger_handler
# database
class SQLAlchemy(_BaseSQLAlchemy):... | en | 0.612911 | # database # logging # TODO - Refine and update when build pipeline is stable. Get from global_config # Secure the application and implement best practice https redirects and a content security policy # ip_ban.init_app(app) # ip_ban.load_nuisances(global_config.IP_BAN_REGEX_FILE) | 2.114382 | 2 |
weibospider/pipelines.py | czyczyyzc/WeiboSpider | 2 | 11180 | <filename>weibospider/pipelines.py
# -*- coding: utf-8 -*-
import os
import csv
import pymongo
from pymongo.errors import DuplicateKeyError
from settings import MONGO_HOST, MONGO_PORT, SAVE_ROOT
class MongoDBPipeline(object):
def __init__(self):
client = pymongo.MongoClient(MONGO_HOST, MONGO_PORT)
... | <filename>weibospider/pipelines.py
# -*- coding: utf-8 -*-
import os
import csv
import pymongo
from pymongo.errors import DuplicateKeyError
from settings import MONGO_HOST, MONGO_PORT, SAVE_ROOT
class MongoDBPipeline(object):
def __init__(self):
client = pymongo.MongoClient(MONGO_HOST, MONGO_PORT)
... | en | 0.563923 | # -*- coding: utf-8 -*- # if item['_id'] not in self.comments_ids: # if item['_id'] not in self.relationships_ids: # if item['_id'] not in self.relationships_ids: # if item['_id'] not in self.users_ids: # if item['_id'] not in self.tweets_ids: # if item['_id'] not in self.reposts_ids: | 2.688003 | 3 |
tests/test_gc3_config.py | ericmharris/gc3-query | 0 | 11181 | from pathlib import Path
from requests.auth import _basic_auth_str
import pytest
from bravado_core.formatter import SwaggerFormat, NO_OP
from gc3_query.lib.gc3_config import GC3Config, IDMCredential
TEST_BASE_DIR: Path = Path(__file__).parent.joinpath("GC3Config")
config_dir = TEST_BASE_DIR.joinpath("config")
def te... | from pathlib import Path
from requests.auth import _basic_auth_str
import pytest
from bravado_core.formatter import SwaggerFormat, NO_OP
from gc3_query.lib.gc3_config import GC3Config, IDMCredential
TEST_BASE_DIR: Path = Path(__file__).parent.joinpath("GC3Config")
config_dir = TEST_BASE_DIR.joinpath("config")
def te... | pt | 0.408348 | # @pytest.fixture() # def get_bravado_config_setup(): # gc3_config = GC3Config() # assert 'iaas_classic' in gc3_config # yield (gc3_config) # # def test_bravado_client_config(get_bravado_config_setup): # gc3_config = get_bravado_config_setup # assert 'iaas_classic' in gc3_config # bravado_client... | 1.913972 | 2 |
lab6/server/datapredict.py | zhiji95/iot | 2 | 11182 | <reponame>zhiji95/iot<filename>lab6/server/datapredict.py
import machine
from machine import *
import ssd1306
import time
import socket
import urequests as requests
import json
word = {'body':8}
labels = ['c', 'o', 'l', 'u', 'm', 'b', 'i', 'a','null']
HOST = '192.168.127.12'
PORT = 8080
flag = 0
stop = False
data = {}... | import machine
from machine import *
import ssd1306
import time
import socket
import urequests as requests
import json
word = {'body':8}
labels = ['c', 'o', 'l', 'u', 'm', 'b', 'i', 'a','null']
HOST = '192.168.127.12'
PORT = 8080
flag = 0
stop = False
data = {}
xdata = []
ydata = []
n = 0
def dp(d):
if (d > 128)... | none | 1 | 2.577117 | 3 | |
Geometry/VeryForwardGeometry/python/dd4hep/geometryRPFromDD_2021_cfi.py | PKUfudawei/cmssw | 2 | 11183 | <gh_stars>1-10
from Geometry.VeryForwardGeometry.dd4hep.v5.geometryRPFromDD_2021_cfi import *
| from Geometry.VeryForwardGeometry.dd4hep.v5.geometryRPFromDD_2021_cfi import * | none | 1 | 0.986495 | 1 | |
examples/plots/warmup_schedule.py | shuoyangd/pytorch_warmup | 170 | 11184 | import argparse
import matplotlib.pyplot as plt
import torch
from pytorch_warmup import *
def get_rates(warmup_cls, beta2, max_step):
rates = []
p = torch.nn.Parameter(torch.arange(10, dtype=torch.float32))
optimizer = torch.optim.Adam([{'params': p}], lr=1.0, betas=(0.9, beta2))
lr_scheduler = torch.... | import argparse
import matplotlib.pyplot as plt
import torch
from pytorch_warmup import *
def get_rates(warmup_cls, beta2, max_step):
rates = []
p = torch.nn.Parameter(torch.arange(10, dtype=torch.float32))
optimizer = torch.optim.Adam([{'params': p}], lr=1.0, betas=(0.9, beta2))
lr_scheduler = torch.... | none | 1 | 2.522993 | 3 | |
plugins/httpev.py | wohali/gizzy | 3 | 11185 | <reponame>wohali/gizzy
"""\
This plugin merely enables other plugins to accept data over HTTP. If
a plugin defines a module level function named "httpev" it will be
invoked for POST requests to the url http://$hostname/event/$pluginname.
The function is invoked from the thread in the web.py request context
and as such ... | """\
This plugin merely enables other plugins to accept data over HTTP. If
a plugin defines a module level function named "httpev" it will be
invoked for POST requests to the url http://$hostname/event/$pluginname.
The function is invoked from the thread in the web.py request context
and as such has access to the full ... | en | 0.745771 | \ This plugin merely enables other plugins to accept data over HTTP. If a plugin defines a module level function named "httpev" it will be invoked for POST requests to the url http://$hostname/event/$pluginname. The function is invoked from the thread in the web.py request context and as such has access to the full web... | 2.551205 | 3 |
ex056.py | danilodelucio/Exercicios_Curso_em_Video | 0 | 11186 | somaIdade = 0
maiorIdade = 0
nomeVelho = ''
totmulher20 = 0
for p in range(1, 3):
print('---- {}ª PESSOA ----'.format(p))
nome = str(input('Nome: ')).strip()
idade = int(input('Idade: '))
sexo = str(input('Sexo [M/F]: '))
somaIdade += idade
if p == 1 and sexo in 'Mm':
maiorIdade = idade
... | somaIdade = 0
maiorIdade = 0
nomeVelho = ''
totmulher20 = 0
for p in range(1, 3):
print('---- {}ª PESSOA ----'.format(p))
nome = str(input('Nome: ')).strip()
idade = int(input('Idade: '))
sexo = str(input('Sexo [M/F]: '))
somaIdade += idade
if p == 1 and sexo in 'Mm':
maiorIdade = idade
... | none | 1 | 3.687685 | 4 | |
python/promort.py | simleo/promort_pipeline | 0 | 11187 | """\
PROMORT example.
"""
import argparse
import random
import sys
import pyecvl.ecvl as ecvl
import pyeddl.eddl as eddl
from pyeddl.tensor import Tensor
import models
def VGG16(in_layer, num_classes):
x = in_layer
x = eddl.ReLu(eddl.Conv(x, 64, [3, 3]))
x = eddl.MaxPool(eddl.ReLu(eddl.Conv(x, 64, [3, ... | """\
PROMORT example.
"""
import argparse
import random
import sys
import pyecvl.ecvl as ecvl
import pyeddl.eddl as eddl
from pyeddl.tensor import Tensor
import models
def VGG16(in_layer, num_classes):
x = in_layer
x = eddl.ReLu(eddl.Conv(x, 64, [3, 3]))
x = eddl.MaxPool(eddl.ReLu(eddl.Conv(x, 64, [3, ... | en | 0.321066 | \ PROMORT example. # size of images #eddl.sgd(0.001, 0.9), #ecvl.AugMirror(.5), #ecvl.AugFlip(.5), #ecvl.AugRotate([-180, 180]), #ecvl.AugAdditivePoissonNoise([0, 10]), #ecvl.AugGammaContrast([0.5, 1.5]), #ecvl.AugGaussianBlur([0, 0.8]), #ecvl.AugCoarseDropout([0, 0.3], [0.02, 0.05], 0.5) #d = ecvl.DLDataset(args.in_ds... | 2.437218 | 2 |
src/view/services_update_page.py | nbilbo/services_manager | 0 | 11188 | from src.view.services_page import ServicesPage
from src.view.services_add_page import ServicesAddPage
class ServicesUpdatePage(ServicesAddPage):
def __init__(self, parent, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
self.set_title("Update service")
self.set_confirm_button_... | from src.view.services_page import ServicesPage
from src.view.services_add_page import ServicesAddPage
class ServicesUpdatePage(ServicesAddPage):
def __init__(self, parent, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
self.set_title("Update service")
self.set_confirm_button_... | none | 1 | 1.969418 | 2 | |
Lib/site-packages/wagtail/utils/l18n/translation.py | SyahmiAmin/belikilo | 0 | 11189 | <filename>Lib/site-packages/wagtail/utils/l18n/translation.py<gh_stars>0
import os
import gettext
import bisect
from locale import getdefaultlocale
from collections.abc import MutableMapping
from copy import copy, deepcopy
import six
class Trans:
def __init__(self):
self.registry = {}
self.curre... | <filename>Lib/site-packages/wagtail/utils/l18n/translation.py<gh_stars>0
import os
import gettext
import bisect
from locale import getdefaultlocale
from collections.abc import MutableMapping
from copy import copy, deepcopy
import six
class Trans:
def __init__(self):
self.registry = {}
self.curre... | en | 0.807039 | # fallback to call the value's attribute in case it's not found in # L18NLazyString # we assume that the separator and the strings have the same encoding # (text_type) # fallback to call the value's attribute in case it's not found in # L18NLazyStringsList Generic dictionary that returns lazy string or lazy string list... | 2.149982 | 2 |
playground/sockets/server.py | tunki/lang-training | 0 | 11190 | import socket
s = socket.socket()
s.bind(("localhost", 9999))
s.listen(1)
sc, addr = s.accept()
while True:
recibido = sc.recv(1024)
if recibido == "quit":
break
print "Recibido:", recibido
sc.send(recibido)
print "adios"
sc.close()
s.close()
| import socket
s = socket.socket()
s.bind(("localhost", 9999))
s.listen(1)
sc, addr = s.accept()
while True:
recibido = sc.recv(1024)
if recibido == "quit":
break
print "Recibido:", recibido
sc.send(recibido)
print "adios"
sc.close()
s.close()
| none | 1 | 2.886316 | 3 | |
examples/example_contour.py | moghimis/geojsoncontour | 63 | 11191 | <filename>examples/example_contour.py
import numpy
import matplotlib.pyplot as plt
import geojsoncontour
# Create lat and lon vectors and grid data
grid_size = 1.0
latrange = numpy.arange(-90.0, 90.0, grid_size)
lonrange = numpy.arange(-180.0, 180.0, grid_size)
X, Y = numpy.meshgrid(lonrange, latrange)
Z = numpy.sqrt(... | <filename>examples/example_contour.py
import numpy
import matplotlib.pyplot as plt
import geojsoncontour
# Create lat and lon vectors and grid data
grid_size = 1.0
latrange = numpy.arange(-90.0, 90.0, grid_size)
lonrange = numpy.arange(-180.0, 180.0, grid_size)
X, Y = numpy.meshgrid(lonrange, latrange)
Z = numpy.sqrt(... | en | 0.769124 | # Create lat and lon vectors and grid data # Create a contour plot plot from grid (lat, lon) data # Convert matplotlib contour to geojson | 3.392395 | 3 |
Graphs/ConnectedComponents.py | PK-100/Competitive_Programming | 70 | 11192 | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'countGroups' function below.
#
# The function is expected to return an INTEGER.
# The function accepts STRING_ARRAY related as parameter.
#
class Graph:
def __init__(self, V):
self.V = V
self.adj = [[] for ... | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'countGroups' function below.
#
# The function is expected to return an INTEGER.
# The function accepts STRING_ARRAY related as parameter.
#
class Graph:
def __init__(self, V):
self.V = V
self.adj = [[] for ... | en | 0.85458 | #!/bin/python3 # # Complete the 'countGroups' function below. # # The function is expected to return an INTEGER. # The function accepts STRING_ARRAY related as parameter. # This is the classical concept of connected components in a Graph Accept the input which is an adjacency matrix and return a Graph, which is an adja... | 4.024286 | 4 |
recognition/ml_model.py | hurschler/pig-face-recognition | 1 | 11193 | <reponame>hurschler/pig-face-recognition
import logging.config
import util.logger_init
import numpy as np
import tensorflow as tf
from sklearn.metrics import confusion_matrix
from util.tensorboard_util import plot_confusion_matrix, plot_to_image
from tensorflow.python.keras.callbacks_v1 import TensorBoard
from keras im... | import logging.config
import util.logger_init
import numpy as np
import tensorflow as tf
from sklearn.metrics import confusion_matrix
from util.tensorboard_util import plot_confusion_matrix, plot_to_image
from tensorflow.python.keras.callbacks_v1 import TensorBoard
from keras import backend as K
class MlModel:
d... | en | 0.608305 | # Define your scheduling function # Use the model to predict the values from the test_images. # Calculate the confusion matrix using sklearn.metrics # Log the confusion matrix as an image summary. # Define TensorBoard callback child class # add other arguments to __init__ if you need | 2.751356 | 3 |
requests/UpdateSubscriptionRequest.py | divinorum-webb/python-tableau-api | 1 | 11194 | <gh_stars>1-10
from .BaseRequest import BaseRequest
class UpdateSubscriptionRequest(BaseRequest):
"""
Update subscription request for generating API request URLs to Tableau Server.
:param ts_connection: The Tableau Server connection object.
:type ts_connection: class
... | from .BaseRequest import BaseRequest
class UpdateSubscriptionRequest(BaseRequest):
"""
Update subscription request for generating API request URLs to Tableau Server.
:param ts_connection: The Tableau Server connection object.
:type ts_connection: class
:param new_subs... | en | 0.651814 | Update subscription request for generating API request URLs to Tableau Server. :param ts_connection: The Tableau Server connection object. :type ts_connection: class :param new_subscription_subject: (Optional) A new subject for the subscription. :type new_subscription_su... | 2.643235 | 3 |
doc/examples/cython/cython_main.py | hershg/ray | 2 | 11195 | <filename>doc/examples/cython/cython_main.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ray
import click
import inspect
import numpy as np
import cython_examples as cyth
def run_func(func, *args, **kwargs):
"""Helper function for running e... | <filename>doc/examples/cython/cython_main.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ray
import click
import inspect
import numpy as np
import cython_examples as cyth
def run_func(func, *args, **kwargs):
"""Helper function for running e... | en | 0.690787 | Helper function for running examples # NOTE: kwargs not allowed for now # Inspect the stack to get calling example Working with Cython actors and functions in Ray Cython def function Cython def function, recursive Cython def function, built-in typed parameter # NOTE: Cython will attempt to cast argument to correct type... | 2.743709 | 3 |
Simon/dev/main_age_classification.py | uncharted-distil/simon | 0 | 11196 | <gh_stars>0
from DataGenerator import *
from Encoder import *
import pandas as pd
from keras.models import Model
from keras.layers import Dense, Activation, Flatten, Input, Dropout, MaxPooling1D, Convolution1D
from keras.layers import LSTM, Lambda, merge, Masking
from keras.layers import Embedding, TimeDistributed
from... | from DataGenerator import *
from Encoder import *
import pandas as pd
from keras.models import Model
from keras.layers import Dense, Activation, Flatten, Input, Dropout, MaxPooling1D, Convolution1D
from keras.layers import LSTM, Lambda, merge, Masking
from keras.layers import Embedding, TimeDistributed
from keras.layer... | en | 0.605826 | # need some threshold-specific rounding code here, presently only for 0.5 thresh. #print("DEBUG::binary accuracy matrix") #print(all_correct_predictions) #print("DEBUG::confusion matrix") #print(all_wrong_predictions) # print(precision_matrix) #positive label for ith sample and jth predicted category #positive label fo... | 2.719316 | 3 |
desdeo_tools/solver/__init__.py | phoopies/desdeo-tools | 1 | 11197 | """This module implements methods for solving scalar valued functions.
"""
__all__ = ["DiscreteMinimizer", "ScalarMethod", "ScalarMinimizer", "ScalarSolverException"]
from desdeo_tools.solver.ScalarSolver import DiscreteMinimizer, ScalarMethod, ScalarMinimizer, ScalarSolverException
| """This module implements methods for solving scalar valued functions.
"""
__all__ = ["DiscreteMinimizer", "ScalarMethod", "ScalarMinimizer", "ScalarSolverException"]
from desdeo_tools.solver.ScalarSolver import DiscreteMinimizer, ScalarMethod, ScalarMinimizer, ScalarSolverException
| en | 0.659651 | This module implements methods for solving scalar valued functions. | 1.564946 | 2 |
tests/test_root_to_hdf.py | lundeenj/hawc_hal | 0 | 11198 | from hawc_hal.maptree.map_tree import map_tree_factory
from hawc_hal.response import hawc_response_factory
import os
from conftest import check_map_trees, check_responses
def test_root_to_hdf_response(response):
r = hawc_response_factory(response)
test_filename = "response.hd5"
# Make sure it doesn't e... | from hawc_hal.maptree.map_tree import map_tree_factory
from hawc_hal.response import hawc_response_factory
import os
from conftest import check_map_trees, check_responses
def test_root_to_hdf_response(response):
r = hawc_response_factory(response)
test_filename = "response.hd5"
# Make sure it doesn't e... | en | 0.96136 | # Make sure it doesn't exist yet, if it does,remove it # Try to open and use it # Test both with a defined ROI and full sky (ROI is None) # Make sure it doesn't exist yet, if it does,remove it # Try to open and use it | 2.320795 | 2 |
clickhouse_driver/compression/zstd.py | risicle/clickhouse-driver | 17 | 11199 | from __future__ import absolute_import
from io import BytesIO
import zstd
from .base import BaseCompressor, BaseDecompressor
from ..protocol import CompressionMethod, CompressionMethodByte
from ..reader import read_binary_uint32
from ..writer import write_binary_uint32, write_binary_uint8
class Compressor(BaseCompr... | from __future__ import absolute_import
from io import BytesIO
import zstd
from .base import BaseCompressor, BaseDecompressor
from ..protocol import CompressionMethod, CompressionMethodByte
from ..reader import read_binary_uint32
from ..writer import write_binary_uint32, write_binary_uint8
class Compressor(BaseCompr... | none | 1 | 2.482505 | 2 |