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 |
|---|---|---|---|---|---|---|---|---|---|---|
annotations/rip_annotated_junctions.py | ChristopherWilks/snaptron | 25 | 3800 | #!/usr/bin/env python
"""
rip_annotated_junctions.py
Non-reference/species verson of this script, no lift-over
Rips junctions from annotation files contained in
jan_24_2016_annotations.tar.gz, as described in annotation_definition.md.
Junctions are dumped to stdout, which we record as annotated_junctions.tsv.gz
in ru... | #!/usr/bin/env python
"""
rip_annotated_junctions.py
Non-reference/species verson of this script, no lift-over
Rips junctions from annotation files contained in
jan_24_2016_annotations.tar.gz, as described in annotation_definition.md.
Junctions are dumped to stdout, which we record as annotated_junctions.tsv.gz
in ru... | en | 0.645875 | #!/usr/bin/env python rip_annotated_junctions.py Non-reference/species verson of this script, no lift-over Rips junctions from annotation files contained in jan_24_2016_annotations.tar.gz, as described in annotation_definition.md. Junctions are dumped to stdout, which we record as annotated_junctions.tsv.gz in runs/s... | 2.178136 | 2 |
dramkit/_tmp/VMD.py | Genlovy-Hoo/dramkit | 0 | 3801 | <gh_stars>0
# -*- coding: utf-8 -*-
import numpy as np
def vmd( signal, alpha, tau, K, DC, init, tol):
'''
用VMD分解算法时只要把信号输入进行分解就行了,只是对信号进行分解,和采样频率没有关系,
VMD的输入参数也没有采样频率。
VMD分解出的各分量在输出量 u 中,这个和信号的长度、信号的采样频率没有关系。
迭代时各分量的中心频率在输出量omega,可以用2*pi/fs*omega求出中心频率,
但迭代时的频率是变化的。
Input and Parameters:... | # -*- coding: utf-8 -*-
import numpy as np
def vmd( signal, alpha, tau, K, DC, init, tol):
'''
用VMD分解算法时只要把信号输入进行分解就行了,只是对信号进行分解,和采样频率没有关系,
VMD的输入参数也没有采样频率。
VMD分解出的各分量在输出量 u 中,这个和信号的长度、信号的采样频率没有关系。
迭代时各分量的中心频率在输出量omega,可以用2*pi/fs*omega求出中心频率,
但迭代时的频率是变化的。
Input and Parameters:
signal ... | en | 0.412458 | # -*- coding: utf-8 -*- 用VMD分解算法时只要把信号输入进行分解就行了,只是对信号进行分解,和采样频率没有关系, VMD的输入参数也没有采样频率。 VMD分解出的各分量在输出量 u 中,这个和信号的长度、信号的采样频率没有关系。 迭代时各分量的中心频率在输出量omega,可以用2*pi/fs*omega求出中心频率, 但迭代时的频率是变化的。 Input and Parameters: signal - the time domain signal (1D) to be decomposed alpha - the balancing param... | 2.519531 | 3 |
src/PyDS/Queue/Deque.py | AoWangPhilly/PyDS | 0 | 3802 | <reponame>AoWangPhilly/PyDS<gh_stars>0
class Deque:
def add_first(self, value):
...
def add_last(self, value):
...
def delete_first(self):
...
def delete_last(self):
...
def first(self):
...
def last(self):
...
def is_empty(self):
... | class Deque:
def add_first(self, value):
...
def add_last(self, value):
...
def delete_first(self):
...
def delete_last(self):
...
def first(self):
...
def last(self):
...
def is_empty(self):
...
def __len__(self):
..... | none | 1 | 3.087868 | 3 | |
forum/main.py | asmaasalih/my_project | 1 | 3803 | <gh_stars>1-10
import models
import stores
member1 =models.Member("ahmed",33)
member2 =models.Member("mohamed",30)
post1=models.Post("Post1", "Content1")
post2= models.Post("Post2", "Content2")
post3= models.Post("Post3", "Content3")
#member store
member_store=stores.MemberStore()
member_store.add(member1)
member_s... | import models
import stores
member1 =models.Member("ahmed",33)
member2 =models.Member("mohamed",30)
post1=models.Post("Post1", "Content1")
post2= models.Post("Post2", "Content2")
post3= models.Post("Post3", "Content3")
#member store
member_store=stores.MemberStore()
member_store.add(member1)
member_store.add(member... | en | 0.814177 | #member store | 2.19495 | 2 |
shellfind.py | bhavyanshu/Shell-Finder | 4 | 3804 | <gh_stars>1-10
#!/usr/bin/env python
'''
Author : <NAME>
Email : <EMAIL>
Description : shellfind.py is a Python command line utility which lets you look for shells on a site that the hacker must have uploaded. It considers all the shells available and tries all possibilities via dictionary match.
'''
import socket
impo... | #!/usr/bin/env python
'''
Author : <NAME>
Email : <EMAIL>
Description : shellfind.py is a Python command line utility which lets you look for shells on a site that the hacker must have uploaded. It considers all the shells available and tries all possibilities via dictionary match.
'''
import socket
import sys
import h... | en | 0.767017 | #!/usr/bin/env python Author : <NAME> Email : <EMAIL> Description : shellfind.py is a Python command line utility which lets you look for shells on a site that the hacker must have uploaded. It considers all the shells available and tries all possibilities via dictionary match. ## ------ Welcome to Shell Finder Utility... | 3.072848 | 3 |
question3.py | nosisky/algo-solution | 1 | 3805 | <gh_stars>1-10
# A string S consisting of N characters is considered to be properly nested if any of the following conditions is true:
# S is empty;
# S has the form "(U)" or "[U]" or "{U}" where U is a properly nested string; S has the form "VW" where V and W are properly nested strings.
# For example, the string "{[(... | # A string S consisting of N characters is considered to be properly nested if any of the following conditions is true:
# S is empty;
# S has the form "(U)" or "[U]" or "{U}" where U is a properly nested string; S has the form "VW" where V and W are properly nested strings.
# For example, the string "{[()()]}" is prope... | en | 0.890758 | # A string S consisting of N characters is considered to be properly nested if any of the following conditions is true: # S is empty; # S has the form "(U)" or "[U]" or "{U}" where U is a properly nested string; S has the form "VW" where V and W are properly nested strings. # For example, the string "{[()()]}" is prope... | 4.295573 | 4 |
Teil_27_Game_of_Life_3d.py | chrMenzel/A-beautiful-code-in-Python | 50 | 3806 | import bpy
import random as rnd
from collections import Counter
import itertools as iter
feld_von, feld_bis = -4, 4
spielfeld_von, spielfeld_bis = feld_von-6, feld_bis+6
anz = int((feld_bis-feld_von)**3*.3)
spielfeld = {(rnd.randint(feld_von, feld_bis), rnd.randint(
feld_von, feld_bis), rnd.randint(feld_von, fe... | import bpy
import random as rnd
from collections import Counter
import itertools as iter
feld_von, feld_bis = -4, 4
spielfeld_von, spielfeld_bis = feld_von-6, feld_bis+6
anz = int((feld_bis-feld_von)**3*.3)
spielfeld = {(rnd.randint(feld_von, feld_bis), rnd.randint(
feld_von, feld_bis), rnd.randint(feld_von, fe... | none | 1 | 2.231934 | 2 | |
power_perceiver/xr_batch_processor/reduce_num_pv_systems.py | openclimatefix/power_perceiver | 0 | 3807 | from dataclasses import dataclass
import numpy as np
import xarray as xr
from power_perceiver.load_prepared_batches.data_sources import PV
from power_perceiver.load_prepared_batches.data_sources.prepared_data_source import XarrayBatch
@dataclass
class ReduceNumPVSystems:
"""Reduce the number of PV systems per e... | from dataclasses import dataclass
import numpy as np
import xarray as xr
from power_perceiver.load_prepared_batches.data_sources import PV
from power_perceiver.load_prepared_batches.data_sources.prepared_data_source import XarrayBatch
@dataclass
class ReduceNumPVSystems:
"""Reduce the number of PV systems per e... | en | 0.848387 | Reduce the number of PV systems per example to `requested_num_pv_systems`. Randomly select PV systems for each example. If there are less PV systems available than requested, then randomly sample with duplicates allowed. This is implemented as an xr_batch_processor so it can run after SelectPVSystemsN... | 2.914124 | 3 |
HelloWorld_python/log/demo_log_3.py | wang153723482/HelloWorld_my | 0 | 3808 | #encoding=utf8
# 按天生成文件
import logging
import time
from logging.handlers import TimedRotatingFileHandler
#----------------------------------------------------------------------
if __name__ == "__main__":
logFilePath = "timed_test.log"
logger = logging.getLogger("YouLoggerName")
logger.setLevel(logging.... | #encoding=utf8
# 按天生成文件
import logging
import time
from logging.handlers import TimedRotatingFileHandler
#----------------------------------------------------------------------
if __name__ == "__main__":
logFilePath = "timed_test.log"
logger = logging.getLogger("YouLoggerName")
logger.setLevel(logging.... | en | 0.100941 | #encoding=utf8 # 按天生成文件 #---------------------------------------------------------------------- # time.sleep(61) | 2.894313 | 3 |
bot_da_os/statemachine/person/person_action.py | Atsocs/bot-da-os | 0 | 3809 | from operator import eq
class PersonAction:
def __init__(self, action):
self.action = action
def __str__(self): return self.action
def __eq__(self, other):
return eq(self.action, other.action)
# Necessary when __cmp__ or __eq__ is defined
# in order to make this class usable as ... | from operator import eq
class PersonAction:
def __init__(self, action):
self.action = action
def __str__(self): return self.action
def __eq__(self, other):
return eq(self.action, other.action)
# Necessary when __cmp__ or __eq__ is defined
# in order to make this class usable as ... | en | 0.807754 | # Necessary when __cmp__ or __eq__ is defined # in order to make this class usable as a # dictionary key: # Static fields; an enumeration of instances: | 3.544417 | 4 |
MyServer.py | bisw1jit/MyServer | 3 | 3810 | # Tool Name :- MyServer
# Author :- LordReaper
# Date :- 13/11/2018 - 9/11/2019
# Powered By :- H1ckPro Software's
import sys
import os
from time import sleep
from core.system import *
if len(sys.argv)>1:
pass
else:
print ("error : invalid arguments !!")
print ("use : myserver --help for more information")
s... | # Tool Name :- MyServer
# Author :- LordReaper
# Date :- 13/11/2018 - 9/11/2019
# Powered By :- H1ckPro Software's
import sys
import os
from time import sleep
from core.system import *
if len(sys.argv)>1:
pass
else:
print ("error : invalid arguments !!")
print ("use : myserver --help for more information")
s... | en | 0.626514 | # Tool Name :- MyServer # Author :- LordReaper # Date :- 13/11/2018 - 9/11/2019 # Powered By :- H1ckPro Software's | 2.42734 | 2 |
tests/test_gen_epub.py | ffreemt/tmx2epub | 0 | 3811 | """ test gen_epub. """
from tmx2epub.gen_epub import gen_epub
def test_gen_epub2():
""" test_gen_epub2. """
from pathlib import Path
infile = r"tests\2.tmx"
stem = Path(infile).absolute().stem
outfile = f"{Path(infile).absolute().parent / stem}.epub"
assert gen_epub(infile, debug=True) == out... | """ test gen_epub. """
from tmx2epub.gen_epub import gen_epub
def test_gen_epub2():
""" test_gen_epub2. """
from pathlib import Path
infile = r"tests\2.tmx"
stem = Path(infile).absolute().stem
outfile = f"{Path(infile).absolute().parent / stem}.epub"
assert gen_epub(infile, debug=True) == out... | el | 0.15765 | test gen_epub. test_gen_epub2. # assert 0 | 2.138603 | 2 |
pub_sub/python/http/checkout/app.py | amulyavarote/quickstarts | 0 | 3812 | import json
import time
import random
import logging
import requests
import os
logging.basicConfig(level=logging.INFO)
base_url = os.getenv('BASE_URL', 'http://localhost') + ':' + os.getenv(
'DAPR_HTTP_PORT', '3500')
PUBSUB_NAME = 'order_pub_sub'
TOPIC = 'orders'
logging.info('Publishing to baseUR... | import json
import time
import random
import logging
import requests
import os
logging.basicConfig(level=logging.INFO)
base_url = os.getenv('BASE_URL', 'http://localhost') + ':' + os.getenv(
'DAPR_HTTP_PORT', '3500')
PUBSUB_NAME = 'order_pub_sub'
TOPIC = 'orders'
logging.info('Publishing to baseUR... | en | 0.616471 | # Publish an event/message using Dapr PubSub via HTTP Post | 2.591472 | 3 |
jj.py | smailedge/pro | 1 | 3813 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from linepy import *
from datetime import datetime
from time import sleep
from humanfriendly import format_timespan, format_size, format_number, format_length
import time, random, sys, json, codecs, threading, glob, re, string, os, requests, subprocess, six, ast, pytz, urllib, ur... | # -*- coding: utf-8 -*-
from linepy import *
from datetime import datetime
from time import sleep
from humanfriendly import format_timespan, format_size, format_number, format_length
import time, random, sys, json, codecs, threading, glob, re, string, os, requests, subprocess, six, ast, pytz, urllib, urllib.parse
#===... | fr | 0.340962 | # -*- coding: utf-8 -*- #==============================================================================# #cl = LINE("TOKEN KAMU") #cl = LINE("Email","Password") #==============================================================================# #=============================================================================... | 2.079322 | 2 |
dd_app/messaging/backend.py | datadealer/dd_app | 2 | 3814 | <gh_stars>1-10
class RedisBackend(object):
def __init__(self, settings={}, *args, **kwargs):
self.settings = settings
@property
def connection(self):
# cached redis connection
if not hasattr(self, '_connection'):
self._connection = self.settings.get('redis.connector').g... | class RedisBackend(object):
def __init__(self, settings={}, *args, **kwargs):
self.settings = settings
@property
def connection(self):
# cached redis connection
if not hasattr(self, '_connection'):
self._connection = self.settings.get('redis.connector').get()
re... | en | 0.571384 | # cached redis connection # Fanout channel # Fanout subscriber # Fanout generator # Fanout emitter # Message queue generator | 2.445798 | 2 |
fetch_data.py | bitfag/bt-macd-binance | 0 | 3815 | <gh_stars>0
#!/usr/bin/env python
from btmacd.binance_fetcher import BinanceFetcher
def main():
fetcher = BinanceFetcher("BTCUSDT", filename="binance_ohlc.csv", start_date="01.01.2018")
fetcher.fetch()
if __name__ == "__main__":
main()
| #!/usr/bin/env python
from btmacd.binance_fetcher import BinanceFetcher
def main():
fetcher = BinanceFetcher("BTCUSDT", filename="binance_ohlc.csv", start_date="01.01.2018")
fetcher.fetch()
if __name__ == "__main__":
main() | ru | 0.26433 | #!/usr/bin/env python | 2.091263 | 2 |
tensorflow_probability/python/mcmc/diagnostic.py | Frightera/probability | 1 | 3816 | # Copyright 2018 The TensorFlow Probability 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 o... | # Copyright 2018 The TensorFlow Probability 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 o... | en | 0.78966 | # Copyright 2018 The TensorFlow Probability 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 o... | 1.696464 | 2 |
mpl/models/leaf.py | jiangyuang/ModelPruningLibrary | 13 | 3817 | from torch import nn as nn
from .base_model import BaseModel
from ..nn.conv2d import DenseConv2d
from ..nn.linear import DenseLinear
__all__ = ["Conv2", "conv2", "Conv4", "conv4"]
class Conv2(BaseModel):
def __init__(self):
super(Conv2, self).__init__()
self.features = nn.Sequential(DenseConv2d(... | from torch import nn as nn
from .base_model import BaseModel
from ..nn.conv2d import DenseConv2d
from ..nn.linear import DenseLinear
__all__ = ["Conv2", "conv2", "Conv4", "conv4"]
class Conv2(BaseModel):
def __init__(self):
super(Conv2, self).__init__()
self.features = nn.Sequential(DenseConv2d(... | it | 0.21667 | # 32x28x28 # 32x14x14 # 64x14x14 # 64x7x7 # TODO: define pretrain etc. | 2.85526 | 3 |
scripts/generate_network_interactomix.py | quimaguirre/NetworkAnalysis | 1 | 3818 | <reponame>quimaguirre/NetworkAnalysis
import argparse
import ConfigParser
import sys, os, re
import biana
try: from biana import *
except: sys.exit(10)
import methods_dictionaries as methods_dicts
def main():
options = parse_user_arguments()
generate_network(options)
def parse_user_argumen... | import argparse
import ConfigParser
import sys, os, re
import biana
try: from biana import *
except: sys.exit(10)
import methods_dictionaries as methods_dicts
def main():
options = parse_user_arguments()
generate_network(options)
def parse_user_arguments(*args, **kwds):
parser = arg... | en | 0.464888 | Network is built in a radius of connections around the seed proteins.
If 0, it creates the complete interactome Type of identifier for the output translation of codes (default is accessionnumber)
Using "proteinsequence" provides with the longest sequence of al... | 2.762766 | 3 |
tests/data/s3_scrape_config.py | kids-first/kf-api-study-creator | 3 | 3819 | <gh_stars>1-10
"""
This is an extract config intended for S3 object manifests produced by TBD.
To use it, you must import it in another extract config and override at least
the `source_data_url`. You may also append additional operations to the
`operations` list as well.
For example you could have the following in yo... | """
This is an extract config intended for S3 object manifests produced by TBD.
To use it, you must import it in another extract config and override at least
the `source_data_url`. You may also append additional operations to the
`operations` list as well.
For example you could have the following in your extract conf... | en | 0.807144 | This is an extract config intended for S3 object manifests produced by TBD. To use it, you must import it in another extract config and override at least the `source_data_url`. You may also append additional operations to the `operations` list as well. For example you could have the following in your extract config m... | 1.820156 | 2 |
hard-gists/5c973ec1b5ab2e387646/snippet.py | jjhenkel/dockerizeme | 21 | 3820 | import bpy
from bpy.app.handlers import persistent
bl_info = {
"name": "Playback Once",
"author": "<NAME>",
"version": (1, 0, 0),
"blender": (2, 67, 3),
"location": "",
"description": "Playback once.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Animation"}
@... | import bpy
from bpy.app.handlers import persistent
bl_info = {
"name": "Playback Once",
"author": "<NAME>",
"version": (1, 0, 0),
"blender": (2, 67, 3),
"location": "",
"description": "Playback once.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Animation"}
@... | none | 1 | 2.452874 | 2 | |
Py3Challenges/saves/challenges/c6_min.py | AlbertUnruh/Py3Challenges | 2 | 3821 | <filename>Py3Challenges/saves/challenges/c6_min.py
"""
To master this you should consider using the builtin-``min``-function.
"""
from ...challenge import Challenge
from random import randint
x = []
for _ in range(randint(2, 10)):
x.append(randint(1, 100))
intro = f"You have to print the lowest value of {', '.jo... | <filename>Py3Challenges/saves/challenges/c6_min.py
"""
To master this you should consider using the builtin-``min``-function.
"""
from ...challenge import Challenge
from random import randint
x = []
for _ in range(randint(2, 10)):
x.append(randint(1, 100))
intro = f"You have to print the lowest value of {', '.jo... | en | 0.817307 | To master this you should consider using the builtin-``min``-function. | 3.796083 | 4 |
services/web/server/tests/unit/with_dbs/01/test_director_v2.py | mrnicegyu11/osparc-simcore | 0 | 3822 | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
from typing import AsyncIterator
import pytest
from aioresponses import aioresponses
from faker import Faker
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st
from models_... | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
from typing import AsyncIterator
import pytest
from aioresponses import aioresponses
from faker import Faker
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st
from models_... | en | 0.214776 | # pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name | 1.821488 | 2 |
tools/py/heatmap.py | sriramreddyM/pLitter | 5 | 3823 | '''
converts video to frames and saves images by different interval, or overlap, etc
'''
import folium
from folium import plugins
from folium.plugins import HeatMap
import csv
# class plitterMap():
# def __int__(self, file_path):
# self.data = file_path
# df = []
# with open(self.data) as f... | '''
converts video to frames and saves images by different interval, or overlap, etc
'''
import folium
from folium import plugins
from folium.plugins import HeatMap
import csv
# class plitterMap():
# def __int__(self, file_path):
# self.data = file_path
# df = []
# with open(self.data) as f... | en | 0.366941 | converts video to frames and saves images by different interval, or overlap, etc # class plitterMap(): # def __int__(self, file_path): # self.data = file_path # df = [] # with open(self.data) as f: # reader = csv.reader(f) # for row in reader: # ... | 3.038919 | 3 |
generator.py | Geoalert/emergency-mapping | 3 | 3824 | import numpy as np
def random_augmentation(img, mask):
#you can add any augmentations you need
return img, mask
def batch_generator(image, mask,
batch_size=1,
crop_size=0,
patch_size=256,
bbox= None,
augment... | import numpy as np
def random_augmentation(img, mask):
#you can add any augmentations you need
return img, mask
def batch_generator(image, mask,
batch_size=1,
crop_size=0,
patch_size=256,
bbox= None,
augment... | en | 0.877197 | #you can add any augmentations you need image: nparray, must have 3 dimension mask: nparray, 2 dimensions, same size as image batch_size: int, number of images in a batch patch_size: int, size of the image returned, patch is square crop_size: int, how much pixels should be cropped off the mask bbox:... | 3.280879 | 3 |
awx/api/metadata.py | Avinesh/awx | 1 | 3825 | # Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
from collections import OrderedDict
# Django
from django.core.exceptions import PermissionDenied
from django.db.models.fields import PositiveIntegerField, BooleanField
from django.db.models.fields.related import ForeignKey
from django.http import Http404
from ... | # Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
from collections import OrderedDict
# Django
from django.core.exceptions import PermissionDenied
from django.db.models.fields import PositiveIntegerField, BooleanField
from django.db.models.fields.related import ForeignKey
from django.http import Http404
from ... | en | 0.815966 | # Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. # Django # Django REST Framework # AWX # Update help text for common fields. # Indicate if a field has a default value. # FIXME: Still isn't showing all default values? # Indicate if a field is write-only. # Special handling of inventory source_region choices th... | 1.815074 | 2 |
plugins/python/tasks.py | BBVA/deeptracy | 85 | 3826 | import json
from washer.worker.actions import AppendStdout, AppendStderr
from washer.worker.actions import CreateNamedLog, AppendToLog
from washer.worker.actions import SetProperty
from washer.worker.commands import washertask
def pipenv_graph2deps(rawgraph):
graph = json.loads(rawgraph)
def build_entry(dat... | import json
from washer.worker.actions import AppendStdout, AppendStderr
from washer.worker.actions import CreateNamedLog, AppendToLog
from washer.worker.actions import SetProperty
from washer.worker.commands import washertask
def pipenv_graph2deps(rawgraph):
graph = json.loads(rawgraph)
def build_entry(dat... | none | 1 | 2.403836 | 2 | |
senity/utils/getSiteProfile.py | pkokkinos/senity | 1 | 3827 | <filename>senity/utils/getSiteProfile.py
import json
import os
# get site profile
def getSiteProfile(site_file):
with open(site_file) as json_file:
json_data = json.load(json_file)
return json_data
# get all site profile
def getAllSiteProfiles(site_folder):
allSiteProfiles = {}
allSiteFile... | <filename>senity/utils/getSiteProfile.py
import json
import os
# get site profile
def getSiteProfile(site_file):
with open(site_file) as json_file:
json_data = json.load(json_file)
return json_data
# get all site profile
def getAllSiteProfiles(site_folder):
allSiteProfiles = {}
allSiteFile... | en | 0.686277 | # get site profile # get all site profile #sites_folder = "sites" #print getAllSiteProfiles(sites_folder) | 2.801953 | 3 |
ppo_new/baseline.py | QingXinHu123/Lane_change_RL | 1 | 3828 | <gh_stars>1-10
import os, sys
from env.LaneChangeEnv import LaneChangeEnv
import random
import numpy as np
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
print('success')
else:
sys.exit("please declare environment variable 'SUMO_HOME'")
import... | import os, sys
from env.LaneChangeEnv import LaneChangeEnv
import random
import numpy as np
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
print('success')
else:
sys.exit("please declare environment variable 'SUMO_HOME'")
import traci
def ep... | en | 0.617192 | # return in current episode # len of current episode # safety gap set to seconds to collision # print(TTC, TTC) # change lane # abort # not a integer, will be broadcasted # f = open('../data/baseline_evaluation/testseed2.csv', 'w+') # safety_gap = 2 # [1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 20.0] # ttcs = [2] # reward: [-89.1... | 2.023468 | 2 |
clean_data.py | toogy/pendigits-hmm | 0 | 3829 | import numpy as np
import pickle
from collections import defaultdict
from parsing import parser
from analysis import training
def main():
parse = parser.Parser();
train_digits = parse.parse_file('data/pendigits-train');
test_digits = parse.parse_file('data/pendigits-test')
centroids = training.get_d... | import numpy as np
import pickle
from collections import defaultdict
from parsing import parser
from analysis import training
def main():
parse = parser.Parser();
train_digits = parse.parse_file('data/pendigits-train');
test_digits = parse.parse_file('data/pendigits-test')
centroids = training.get_d... | none | 1 | 2.761145 | 3 | |
scripts/commit_validation/commit_validation/commit_validation.py | cypherdotXd/o3de | 8 | 3830 | #
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import abc
import importlib
import os
import pkgutil
import re
import time
from typing import Dict, List, ... | #
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import abc
import importlib
import os
import pkgutil
import re
import time
from typing import Dict, List, ... | en | 0.796568 | # # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # An interface for accessing details about a commit Returns a list of local files added/modified by the commi... | 2.635754 | 3 |
matrixprofile/algorithms/snippets.py | KSaiRahul21/matrixprofile | 0 | 3831 | <filename>matrixprofile/algorithms/snippets.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
range = getattr(__builtins__, 'xrange', range)
# end of py2 compatability boi... | <filename>matrixprofile/algorithms/snippets.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
range = getattr(__builtins__, 'xrange', range)
# end of py2 compatability boi... | en | 0.796075 | #!/usr/bin/env python # -*- coding: utf-8 -*- # end of py2 compatability boilerplate The snippets algorithm is used to summarize your time series by identifying N number of representative subsequences. If you want to identify typical patterns in your time series, then this is the algorithm to use. Para... | 2.94379 | 3 |
jina/logging/formatter.py | yk/jina | 1 | 3832 | import json
import re
from copy import copy
from logging import Formatter
from .profile import used_memory
from ..helper import colored
class ColorFormatter(Formatter):
"""Format the log into colored logs based on the log-level. """
MAPPING = {
'DEBUG': dict(color='white', on_color=None), # white
... | import json
import re
from copy import copy
from logging import Formatter
from .profile import used_memory
from ..helper import colored
class ColorFormatter(Formatter):
"""Format the log into colored logs based on the log-level. """
MAPPING = {
'DEBUG': dict(color='white', on_color=None), # white
... | en | 0.865227 | Format the log into colored logs based on the log-level. # white # cyan # yellow # 31 for red # white on red bg # white on red bg #: log-level to color mapping # default white Remove all control chars from the log and format it as plain text Also restrict the max-length of msg to 512 Format the log message as a JS... | 2.400691 | 2 |
atcoder/abc191/b.py | sugitanishi/competitive-programming | 0 | 3833 | import sys
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
n,x=map(int,input().split())
a=list(map(int,input().split()))
aa=list(filter(lambda b:b!=x,a))
print(*aa) | import sys
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
n,x=map(int,input().split())
a=list(map(int,input().split()))
aa=list(filter(lambda b:b!=x,a))
print(*aa) | none | 1 | 2.531171 | 3 | |
tests/integration/test_streaming_e2e.py | cfogg/python-client | 0 | 3834 | <gh_stars>0
"""Streaming integration tests."""
# pylint:disable=no-self-use,invalid-name,too-many-arguments,too-few-public-methods,line-too-long
# pylint:disable=too-many-statements,too-many-locals,too-many-lines
import threading
import time
import json
from queue import Queue
from splitio.client.factory import get_fac... | """Streaming integration tests."""
# pylint:disable=no-self-use,invalid-name,too-many-arguments,too-few-public-methods,line-too-long
# pylint:disable=too-many-statements,too-many-locals,too-many-lines
import threading
import time
import json
from queue import Queue
from splitio.client.factory import get_factory
from te... | en | 0.865576 | Streaming integration tests. # pylint:disable=no-self-use,invalid-name,too-many-arguments,too-few-public-methods,line-too-long # pylint:disable=too-many-statements,too-many-locals,too-many-lines # try to import python3 names. fallback to python2 Test streaming operation and failover. Test initialization & splits/segmen... | 2.28258 | 2 |
venues/abstract_venue.py | weezel/BandEventNotifier | 0 | 3835 | import re
from abc import ABC, abstractmethod
from typing import Any, Dict, Generator
class IncorrectVenueImplementation(Exception):
pass
# class AbstractVenue(metaclass=ABC):
class AbstractVenue(ABC):
def __init__(self):
self.url = ""
self.name = ""
self.city = ""
self.count... | import re
from abc import ABC, abstractmethod
from typing import Any, Dict, Generator
class IncorrectVenueImplementation(Exception):
pass
# class AbstractVenue(metaclass=ABC):
class AbstractVenue(ABC):
def __init__(self):
self.url = ""
self.name = ""
self.city = ""
self.count... | en | 0.543598 | # class AbstractVenue(metaclass=ABC): # FIXME Proper class type checking | 3.160469 | 3 |
mtl/util/pipeline.py | vandurme/TFMTL | 10 | 3836 | # Copyright 2018 Johns Hopkins University. 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 2018 Johns Hopkins University. 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.790308 | # Copyright 2018 Johns Hopkins University. 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... | 2.183812 | 2 |
src/py65/devices/mpu65c02.py | dabeaz/py65 | 5 | 3837 | from py65.devices import mpu6502
from py65.utils.devices import make_instruction_decorator
class MPU(mpu6502.MPU):
def __init__(self, *args, **kwargs):
mpu6502.MPU.__init__(self, *args, **kwargs)
self.name = '65C02'
self.waiting = False
def step(self):
if self.waiting:
... | from py65.devices import mpu6502
from py65.utils.devices import make_instruction_decorator
class MPU(mpu6502.MPU):
def __init__(self, *args, **kwargs):
mpu6502.MPU.__init__(self, *args, **kwargs)
self.name = '65C02'
self.waiting = False
def step(self):
if self.waiting:
... | en | 0.841232 | # Make copies of the lists # addressing modes # operations # instructions # Don't know cycles | 2.608365 | 3 |
tests/test__io.py | soerendip/ms-mint | 1 | 3838 | import pandas as pd
import shutil
import os
import io
from ms_mint.Mint import Mint
from pathlib import Path as P
from ms_mint.io import (
ms_file_to_df,
mzml_to_pandas_df_pyteomics,
convert_ms_file_to_feather,
convert_ms_file_to_parquet,
MZMLB_AVAILABLE,
)
from paths import (
TEST_MZML,
... | import pandas as pd
import shutil
import os
import io
from ms_mint.Mint import Mint
from pathlib import Path as P
from ms_mint.io import (
ms_file_to_df,
mzml_to_pandas_df_pyteomics,
convert_ms_file_to_feather,
convert_ms_file_to_parquet,
MZMLB_AVAILABLE,
)
from paths import (
TEST_MZML,
... | en | 0.277518 | # assert all(result.polarity == '+'), f'Polarity should be "+"\n{result}' | 2.390159 | 2 |
core/views.py | moiyad/image | 0 | 3839 | <filename>core/views.py
from django.core.files.storage import FileSystemStorage
from django.shortcuts import render, redirect
from core.forms import DocumentForm
from core.models import Document
from media import image_cv2
def home(request):
documents = Document.objects.all()
number = len(image_cv2.myList)
... | <filename>core/views.py
from django.core.files.storage import FileSystemStorage
from django.shortcuts import render, redirect
from core.forms import DocumentForm
from core.models import Document
from media import image_cv2
def home(request):
documents = Document.objects.all()
number = len(image_cv2.myList)
... | none | 1 | 2.204689 | 2 | |
python/verifair/benchmarks/fairsquare/M_BN_F_SVM_A_Q.py | obastani/verifair | 5 | 3840 | <reponame>obastani/verifair
from .helper import *
def sample(flag):
sex = step([(0,1,0.3307), (1,2,0.6693)])
if sex < 1:
capital_gain = gaussian(568.4105, 24248365.5428)
if capital_gain < 7298.0000:
age = gaussian(38.4208, 184.9151)
capital_loss = gaussian(86.5949, 15773... | from .helper import *
def sample(flag):
sex = step([(0,1,0.3307), (1,2,0.6693)])
if sex < 1:
capital_gain = gaussian(568.4105, 24248365.5428)
if capital_gain < 7298.0000:
age = gaussian(38.4208, 184.9151)
capital_loss = gaussian(86.5949, 157731.9553)
else:
... | none | 1 | 2.196877 | 2 | |
ml4chem/atomistic/models/neuralnetwork.py | muammar/mlchem | 77 | 3841 | <filename>ml4chem/atomistic/models/neuralnetwork.py
import dask
import datetime
import logging
import time
import torch
import numpy as np
import pandas as pd
from collections import OrderedDict
from ml4chem.metrics import compute_rmse
from ml4chem.atomistic.models.base import DeepLearningModel, DeepLearningTrainer
fr... | <filename>ml4chem/atomistic/models/neuralnetwork.py
import dask
import datetime
import logging
import time
import torch
import numpy as np
import pandas as pd
from collections import OrderedDict
from ml4chem.metrics import compute_rmse
from ml4chem.atomistic.models.base import DeepLearningModel, DeepLearningTrainer
fr... | en | 0.769215 | # Setting precision and starting logger object Atom-centered Neural Network Regression with Pytorch This model is based on Ref. 1 by Behler and Parrinello. Parameters ---------- hiddenlayers : tuple Structure of hidden layers in the neural network. activation : str Activation funct... | 2.335258 | 2 |
hatsploit/core/db/db.py | EntySec/HatSploit | 139 | 3842 | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2022 EntySec
#
# 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... | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2022 EntySec
#
# 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... | en | 0.744252 | #!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2022 EntySec # # 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 ... | 2.025098 | 2 |
bluesky/tests/test_simulators.py | NSLS-II/bluesky | 43 | 3843 | from bluesky.plans import scan
from bluesky.simulators import (print_summary, print_summary_wrapper,
summarize_plan,
check_limits,
plot_raster_path)
import pytest
from bluesky.plans import grid_scan
def test_print_summary(... | from bluesky.plans import scan
from bluesky.simulators import (print_summary, print_summary_wrapper,
summarize_plan,
check_limits,
plot_raster_path)
import pytest
from bluesky.plans import grid_scan
def test_print_summary(... | en | 0.703497 | # old name # new name # The motor object does not currently implement limits. # Use an assert to help us out if this changes in the future. # # check_limits should warn if it can't find check_value # TODO: Is there _any_ object to test? # with pytest.warns(UserWarning): # check_limits(scan([det], motor, -1, 1, 3)) ... | 2.100502 | 2 |
shutTheBox/main.py | robi1467/shut-the-box | 0 | 3844 | <filename>shutTheBox/main.py
import random
numbers_list = [1,2,3,4,5,6,7,8,9,10]
game_won = False
game_completed = False
#Stats
games_played = 0
games_won = 0
games_lost = 0
average_score = 0
total_score = 0
def welcome():
welcome_message = "Welcome to shut the box"
print(welcome_message)
i = 0
result ... | <filename>shutTheBox/main.py
import random
numbers_list = [1,2,3,4,5,6,7,8,9,10]
game_won = False
game_completed = False
#Stats
games_played = 0
games_won = 0
games_lost = 0
average_score = 0
total_score = 0
def welcome():
welcome_message = "Welcome to shut the box"
print(welcome_message)
i = 0
result ... | none | 1 | 4.100315 | 4 | |
repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_selinux.py | sm00th/leapp-repository | 21 | 3845 | import warnings
import pytest
from leapp.libraries.actor.systemfacts import get_selinux_status
from leapp.models import SELinuxFacts
no_selinux = False
try:
import selinux
except ImportError:
no_selinux = True
warnings.warn(
'Tests which uses `selinux` will be skipped'
' due to library un... | import warnings
import pytest
from leapp.libraries.actor.systemfacts import get_selinux_status
from leapp.models import SELinuxFacts
no_selinux = False
try:
import selinux
except ImportError:
no_selinux = True
warnings.warn(
'Tests which uses `selinux` will be skipped'
' due to library un... | en | 0.508063 | # FIXME: create valid tests... Test case SELinux is enabled in enforcing mode Test case SELinux is enabled in permissive mode Test case SELinux is disabled Test case SELinux is disabled | 2.362635 | 2 |
Phase-1/Python Basic 2/Day-24.py | emetowinner/python-challenges | 3 | 3846 | <gh_stars>1-10
"""
1. Write a Python program to reverse only the vowels of a given string.
Sample Output:
w3resuorce
Python
Perl
ASU
2. Write a Python program to check whether a given integer is a palindrome or not.
Note: An integer is a palindrome when it reads the same backward as forward. Negative numbers are not ... | """
1. Write a Python program to reverse only the vowels of a given string.
Sample Output:
w3resuorce
Python
Perl
ASU
2. Write a Python program to check whether a given integer is a palindrome or not.
Note: An integer is a palindrome when it reads the same backward as forward. Negative numbers are not palindromic.
Sa... | en | 0.783297 | 1. Write a Python program to reverse only the vowels of a given string. Sample Output: w3resuorce Python Perl ASU 2. Write a Python program to check whether a given integer is a palindrome or not. Note: An integer is a palindrome when it reads the same backward as forward. Negative numbers are not palindromic. Sample ... | 4.263028 | 4 |
etl/parsers/etw/Microsoft_Windows_IPxlatCfg.py | IMULMUL/etl-parser | 104 | 3847 | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-IPxlatCfg
GUID : 3e5ac668-af52-4c15-b99b-a3e7a6616ebd
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.p... | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-IPxlatCfg
GUID : 3e5ac668-af52-4c15-b99b-a3e7a6616ebd
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.p... | en | 0.145916 | # -*- coding: utf-8 -*- Microsoft-Windows-IPxlatCfg GUID : 3e5ac668-af52-4c15-b99b-a3e7a6616ebd | 1.769082 | 2 |
microservices/users/config.py | Levakin/sanic-test-app | 0 | 3848 | <reponame>Levakin/sanic-test-app
# -*- coding: utf-8 -*-
import os
from distutils.util import strtobool
class Config:
DEBUG = bool(strtobool(os.getenv('DEBUG', "False")))
DATABASE_URI = os.getenv('DATABASE_URI', '127.0.0.1:27017')
WORKERS = int(os.getenv('WORKERS', 2))
LOGO = os.getenv('LOGO', None)
... | # -*- coding: utf-8 -*-
import os
from distutils.util import strtobool
class Config:
DEBUG = bool(strtobool(os.getenv('DEBUG', "False")))
DATABASE_URI = os.getenv('DATABASE_URI', '127.0.0.1:27017')
WORKERS = int(os.getenv('WORKERS', 2))
LOGO = os.getenv('LOGO', None)
HOST = os.getenv('HOST', '127... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.986781 | 2 |
semantic-python/test/fixtures/4-01-lambda-literals.py | Temurson/semantic | 8,844 | 3849 | <reponame>Temurson/semantic<gh_stars>1000+
# CHECK-TREE: { const <- \x -> \y -> x; y <- const #true #true; z <- const #false #false; #record { const: const, y : y, z: z, }}
const = lambda x, y: x
y = const(True, True)
z = const(False, False)
| # CHECK-TREE: { const <- \x -> \y -> x; y <- const #true #true; z <- const #false #false; #record { const: const, y : y, z: z, }}
const = lambda x, y: x
y = const(True, True)
z = const(False, False) | en | 0.110268 | # CHECK-TREE: { const <- \x -> \y -> x; y <- const #true #true; z <- const #false #false; #record { const: const, y : y, z: z, }} | 1.768869 | 2 |
main.py | mithi/semantic-segmentation | 33 | 3850 | <filename>main.py
import tensorflow as tf
import os.path
import warnings
from distutils.version import LooseVersion
import glob
import helper
import project_tests as tests
#--------------------------
# USER-SPECIFIED DATA
#--------------------------
# Tune these parameters
NUMBER_OF_CLASSES = 2
IMAGE_SHAPE = (160, ... | <filename>main.py
import tensorflow as tf
import os.path
import warnings
from distutils.version import LooseVersion
import glob
import helper
import project_tests as tests
#--------------------------
# USER-SPECIFIED DATA
#--------------------------
# Tune these parameters
NUMBER_OF_CLASSES = 2
IMAGE_SHAPE = (160, ... | en | 0.728308 | #-------------------------- # USER-SPECIFIED DATA #-------------------------- # Tune these parameters # Specify these directory paths # Used for plotting to visualize if our training is going well given parameters #-------------------------- # DEPENDENCY CHECK #-------------------------- # Check TensorFlow Version # Ch... | 2.591666 | 3 |
tests/scanner/audit/log_sink_rules_engine_test.py | BrunoReboul/forseti-security | 0 | 3851 | <gh_stars>0
# Copyright 2018 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | # Copyright 2018 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | en | 0.89351 | # Copyright 2018 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap... | 1.761258 | 2 |
backend/api/ulca-ums-service/user-management/utilities/orgUtils.py | agupta54/ulca | 3 | 3852 | import uuid
from config import USR_ORG_MONGO_COLLECTION, USR_MONGO_COLLECTION
import db
from models.response import post_error
import logging
log = logging.getLogger('file')
class OrgUtils:
def __init__(self):
pass
#orgId generation
@staticmethod
def generate_org_id():
"""UUID gener... | import uuid
from config import USR_ORG_MONGO_COLLECTION, USR_MONGO_COLLECTION
import db
from models.response import post_error
import logging
log = logging.getLogger('file')
class OrgUtils:
def __init__(self):
pass
#orgId generation
@staticmethod
def generate_org_id():
"""UUID gener... | en | 0.772707 | #orgId generation UUID generation for org registeration Validating Org Org should be registered and active on Anuvaad system. #connecting to mongo instance/collection #searching for active org record Org validation on upsert deactivation of org allowed only once all the users in the corresponding org ... | 2.509507 | 3 |
setup.py | AntonBiryukovUofC/diffvg | 0 | 3853 | <reponame>AntonBiryukovUofC/diffvg
# Adapted from https://github.com/pybind/cmake_example/blob/master/setup.py
import os
import re
import sys
import platform
import subprocess
import importlib
from sysconfig import get_paths
import importlib
from setuptools import setup, Extension
from setuptools.command.build_ext imp... | # Adapted from https://github.com/pybind/cmake_example/blob/master/setup.py
import os
import re
import sys
import platform
import subprocess
import importlib
from sysconfig import get_paths
import importlib
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from setuptools.comma... | en | 0.74863 | # Adapted from https://github.com/pybind/cmake_example/blob/master/setup.py # Override build_with_cuda with environment variable | 1.849266 | 2 |
robotpy_ext/common_drivers/navx/registerio.py | twinters007/robotpy-wpilib-utilities | 2 | 3854 | # validated: 2017-02-19 DS c5e3a8a9b642 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO.java
#----------------------------------------------------------------------------
# Copyright (c) <NAME> 2015. All Rights Reserved.
#
# Created in support of Team 2465 (Kauaibots). Go Purple Wave!
#
# Open Source Softw... | # validated: 2017-02-19 DS c5e3a8a9b642 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO.java
#----------------------------------------------------------------------------
# Copyright (c) <NAME> 2015. All Rights Reserved.
#
# Created in support of Team 2465 (Kauaibots). Go Purple Wave!
#
# Open Source Softw... | en | 0.689567 | # validated: 2017-02-19 DS c5e3a8a9b642 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO.java #---------------------------------------------------------------------------- # Copyright (c) <NAME> 2015. All Rights Reserved. # # Created in support of Team 2465 (Kauaibots). Go Purple Wave! # # Open Source Softw... | 1.697581 | 2 |
RigolWFM/channel.py | wvdv2002/RigolWFM | 0 | 3855 | #pylint: disable=invalid-name
#pylint: disable=too-many-instance-attributes
#pylint: disable=too-many-return-statements
#pylint: disable=too-many-statements
"""
Class structure and methods for an oscilloscope channel.
The idea is to collect all the relevant information from all the Rigol
scope waveforms into a single ... | #pylint: disable=invalid-name
#pylint: disable=too-many-instance-attributes
#pylint: disable=too-many-return-statements
#pylint: disable=too-many-statements
"""
Class structure and methods for an oscilloscope channel.
The idea is to collect all the relevant information from all the Rigol
scope waveforms into a single ... | en | 0.719584 | #pylint: disable=invalid-name #pylint: disable=too-many-instance-attributes #pylint: disable=too-many-return-statements #pylint: disable=too-many-statements Class structure and methods for an oscilloscope channel. The idea is to collect all the relevant information from all the Rigol scope waveforms into a single stru... | 2.948175 | 3 |
configs/raubtierv2a/faster_rcnn_x101_64x4d_fpn_1x_raubtierv2a_nofreeze_4gpu.py | esf-bt2020/mmdetection | 0 | 3856 | _base_ = '../faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py'
model = dict(
backbone=dict(
num_stages=4,
#frozen_stages=4
),
roi_head=dict(
bbox_head=dict(
num_classes=3
)
)
)
dataset_type = 'COCODataset'
classes = ('luchs', 'rotfuchs', 'wolf')
data = dict... | _base_ = '../faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py'
model = dict(
backbone=dict(
num_stages=4,
#frozen_stages=4
),
roi_head=dict(
bbox_head=dict(
num_classes=3
)
)
)
dataset_type = 'COCODataset'
classes = ('luchs', 'rotfuchs', 'wolf')
data = dict... | en | 0.344697 | #frozen_stages=4 #optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) #original (8x2=16) #(4x2=8) 4 GPUs #optimizer = dict(type='SGD', lr=0.0025, momentum=0.9, weight_decay=0.0001) #(1x2=2) #http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco/faster_rcnn_x1... | 1.7531 | 2 |
driver/python/setup.py | wbaweto/QConf | 2,056 | 3857 | <filename>driver/python/setup.py
from distutils.core import setup, Extension
setup(name = 'qconf_py', version = '1.2.2', ext_modules = [Extension('qconf_py', ['lib/python_qconf.cc'],
include_dirs=['/usr/local/include/qconf'],
extra_objects=['/usr/local/qconf/lib/libqconf.a']
)])
| <filename>driver/python/setup.py
from distutils.core import setup, Extension
setup(name = 'qconf_py', version = '1.2.2', ext_modules = [Extension('qconf_py', ['lib/python_qconf.cc'],
include_dirs=['/usr/local/include/qconf'],
extra_objects=['/usr/local/qconf/lib/libqconf.a']
)])
| none | 1 | 1.308295 | 1 | |
abc153/d.py | Lockdef/kyopro-code | 0 | 3858 | h = int(input())
i = 1
a = 1
b = 1
c = 1
while h >= a:
a = 2 ** i
i += 1
s = 0
t = True
for j in range(1, i-1):
c += 2 ** j
print(c)
| h = int(input())
i = 1
a = 1
b = 1
c = 1
while h >= a:
a = 2 ** i
i += 1
s = 0
t = True
for j in range(1, i-1):
c += 2 ** j
print(c)
| none | 1 | 3.436491 | 3 | |
demos/python/sdk_wireless_camera_control/open_gopro/demos/log_battery.py | Natureshadow/OpenGoPro | 210 | 3859 | <filename>demos/python/sdk_wireless_camera_control/open_gopro/demos/log_battery.py<gh_stars>100-1000
# log_battery.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:45 PM
"""Example to continuously read the battery (wi... | <filename>demos/python/sdk_wireless_camera_control/open_gopro/demos/log_battery.py<gh_stars>100-1000
# log_battery.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:45 PM
"""Example to continuously read the battery (wi... | en | 0.833568 | # log_battery.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Wed, Sep 1, 2021 5:05:45 PM Example to continuously read the battery (with no Wifi connection) # rich consoler printer Simple class to store battery samples # pylint: disable=mi... | 2.705401 | 3 |
tumbleweed/models.py | mcroydon/django-tumbleweed | 1 | 3860 | <reponame>mcroydon/django-tumbleweed<filename>tumbleweed/models.py
# These are not the droids you are looking for. | # These are not the droids you are looking for. | en | 0.960568 | # These are not the droids you are looking for. | 1.084558 | 1 |
xos/hpc_observer/steps/sync_originserver.py | wathsalav/xos | 0 | 3861 | import os
import sys
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from hpc.models import ServiceProvider, ContentProvider, CDNPrefix, OriginServer
from util.logger import Logger, logging
# hpclibrary will be in ste... | import os
import sys
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from hpc.models import ServiceProvider, ContentProvider, CDNPrefix, OriginServer
from util.logger import Logger, logging
# hpclibrary will be in ste... | en | 0.876088 | # hpclibrary will be in steps/.. #self.consistency_check() # set to true if something changed # sanity check to make sure our PS objects have CMI objects behind them # we have an origin server ID, but it doesn't exist in the CMI # something went wrong # start over # validation requires URL start with http:// #print os_... | 1.925138 | 2 |
main.py | aroxby/pixel-processor | 0 | 3862 | #!/usr/bin/env python3
from PIL import Image
def tranform(r, g, b):
tmp = b
b = g // 2
g = tmp
r = r // 2
return r, g, b
def main():
im = Image.open('blue-flames.jpg')
input_pixels = im.getdata()
output_pixels = tuple(tranform(*pixel) for pixel in input_pixels)
im.putdata(output_... | #!/usr/bin/env python3
from PIL import Image
def tranform(r, g, b):
tmp = b
b = g // 2
g = tmp
r = r // 2
return r, g, b
def main():
im = Image.open('blue-flames.jpg')
input_pixels = im.getdata()
output_pixels = tuple(tranform(*pixel) for pixel in input_pixels)
im.putdata(output_... | fr | 0.221828 | #!/usr/bin/env python3 | 3.428951 | 3 |
scipy/weave/examples/swig2_example.py | lesserwhirls/scipy-cwt | 8 | 3863 | <reponame>lesserwhirls/scipy-cwt<filename>scipy/weave/examples/swig2_example.py
"""Simple example to show how to use weave.inline on SWIG2 wrapped
objects. SWIG2 refers to SWIG versions >= 1.3.
To run this example you must build the trivial SWIG2 extension called
swig2_ext. To do this you need to do something like t... | """Simple example to show how to use weave.inline on SWIG2 wrapped
objects. SWIG2 refers to SWIG versions >= 1.3.
To run this example you must build the trivial SWIG2 extension called
swig2_ext. To do this you need to do something like this::
$ swig -c++ -python -I. -o swig2_ext_wrap.cxx swig2_ext.i
$ g++ -Wall ... | en | 0.667376 | Simple example to show how to use weave.inline on SWIG2 wrapped objects. SWIG2 refers to SWIG versions >= 1.3. To run this example you must build the trivial SWIG2 extension called swig2_ext. To do this you need to do something like this:: $ swig -c++ -python -I. -o swig2_ext_wrap.cxx swig2_ext.i $ g++ -Wall -O2... | 2.652599 | 3 |
src/simplify.py | denghz/Probabilistic-Programming | 0 | 3864 | <filename>src/simplify.py
from wolframclient.language.expression import WLSymbol
from nnDiff import *
def parseGlobalSymbol(s):
if isinstance(s, numbers.Number):
return s
if isinstance(s, WLSymbol):
if s.name == 'E':
return 'E'
else:
return s.name[7:]
de... | <filename>src/simplify.py
from wolframclient.language.expression import WLSymbol
from nnDiff import *
def parseGlobalSymbol(s):
if isinstance(s, numbers.Number):
return s
if isinstance(s, WLSymbol):
if s.name == 'E':
return 'E'
else:
return s.name[7:]
de... | none | 1 | 2.995941 | 3 | |
setup.py | EdWard680/python-firetv | 0 | 3865 | from setuptools import setup
setup(
name='firetv',
version='1.0.7',
description='Communicate with an Amazon Fire TV device via ADB over a network.',
url='https://github.com/happyleavesaoc/python-firetv/',
license='MIT',
author='happyleaves',
author_email='<EMAIL>',
packages=['firetv'],
... | from setuptools import setup
setup(
name='firetv',
version='1.0.7',
description='Communicate with an Amazon Fire TV device via ADB over a network.',
url='https://github.com/happyleavesaoc/python-firetv/',
license='MIT',
author='happyleaves',
author_email='<EMAIL>',
packages=['firetv'],
... | none | 1 | 1.515793 | 2 | |
neo/io/exampleio.py | Mario-Kart-Felix/python-neo | 199 | 3866 | <gh_stars>100-1000
"""
neo.io have been split in 2 level API:
* neo.io: this API give neo object
* neo.rawio: this API give raw data as they are in files.
Developper are encourage to use neo.rawio.
When this is done the neo.io is done automagically with
this king of following code.
Author: sgarcia
"""
from neo... | """
neo.io have been split in 2 level API:
* neo.io: this API give neo object
* neo.rawio: this API give raw data as they are in files.
Developper are encourage to use neo.rawio.
When this is done the neo.io is done automagically with
this king of following code.
Author: sgarcia
"""
from neo.io.basefromrawio i... | en | 0.85155 | neo.io have been split in 2 level API: * neo.io: this API give neo object * neo.rawio: this API give raw data as they are in files. Developper are encourage to use neo.rawio. When this is done the neo.io is done automagically with this king of following code. Author: sgarcia # This is an inportant choice when th... | 2.669844 | 3 |
scrapyproject/migrations/0003_auto_20170209_1025.py | sap9433/Distributed-Multi-User-Scrapy-System-with-a-Web-UI | 108 | 3867 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scrapyproject', '0002_auto_20170208_1738'),
]
operations = [
migrations.AlterField(
model_name='project',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scrapyproject', '0002_auto_20170208_1738'),
]
operations = [
migrations.AlterField(
model_name='project',
... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.457453 | 1 |
src/cart/forms.py | cbsBiram/xarala__ssr | 0 | 3868 | from django import forms
from django.utils.translation import gettext_lazy as _
COURSE_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 21)]
class CartAddCourseForm(forms.Form):
quantity = forms.TypedChoiceField(
choices=COURSE_QUANTITY_CHOICES, coerce=int, label=_("Quantité")
)
override = form... | from django import forms
from django.utils.translation import gettext_lazy as _
COURSE_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 21)]
class CartAddCourseForm(forms.Form):
quantity = forms.TypedChoiceField(
choices=COURSE_QUANTITY_CHOICES, coerce=int, label=_("Quantité")
)
override = form... | none | 1 | 2.373663 | 2 | |
patches/datasets/__init__.py | sflippl/patches | 0 | 3869 | <reponame>sflippl/patches<gh_stars>0
"""Datasets of latent predictability tasks.
"""
from .pilgrimm import *
| """Datasets of latent predictability tasks.
"""
from .pilgrimm import * | en | 0.552144 | Datasets of latent predictability tasks. | 0.990999 | 1 |
appengine/components/tests/datastore_utils_properties_test.py | pombreda/swarming | 0 | 3870 | <filename>appengine/components/tests/datastore_utils_properties_test.py
#!/usr/bin/env python
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
import sys
import unittest
import test_env
test_env.setup_... | <filename>appengine/components/tests/datastore_utils_properties_test.py
#!/usr/bin/env python
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
import sys
import unittest
import test_env
test_env.setup_... | en | 0.86358 | #!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. | 2.180401 | 2 |
neutron/tests/unit/services/qos/test_qos_plugin.py | dangervon/neutron | 0 | 3871 | # 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, software
# d... | # 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, software
# d... | en | 0.839605 | # 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, software # d... | 1.136015 | 1 |
covfefe/covfefe.py | fixator10/Trusty-cogs | 148 | 3872 | import re
import discord
from redbot.core import commands
class Covfefe(commands.Cog):
"""
Convert almost any word into covfefe
"""
def __init__(self, bot):
self.bot = bot
async def covfefe(self, x, k="aeiouy])"):
"""
https://codegolf.stackexchange.com/a/123697
"... | import re
import discord
from redbot.core import commands
class Covfefe(commands.Cog):
"""
Convert almost any word into covfefe
"""
def __init__(self, bot):
self.bot = bot
async def covfefe(self, x, k="aeiouy])"):
"""
https://codegolf.stackexchange.com/a/123697
"... | en | 0.883658 | Convert almost any word into covfefe https://codegolf.stackexchange.com/a/123697 Nothing to delete Convert almost any word into covfefe | 2.879265 | 3 |
src/api/bkuser_core/audit/views.py | trueware/bk-user | 0 | 3873 | <reponame>trueware/bk-user
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except... | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | en | 0.864626 | # -*- coding: utf-8 -*- TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License... | 1.764976 | 2 |
exp_gqa/test.py | ronghanghu/gqa_single_hop_baseline | 19 | 3874 | import os
import numpy as np
import tensorflow as tf
from models_gqa.model import Model
from models_gqa.config import build_cfg_from_argparse
from util.gqa_train.data_reader import DataReader
import json
# Load config
cfg = build_cfg_from_argparse()
# Start session
os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.GPU_ID... | import os
import numpy as np
import tensorflow as tf
from models_gqa.model import Model
from models_gqa.config import build_cfg_from_argparse
from util.gqa_train.data_reader import DataReader
import json
# Load config
cfg = build_cfg_from_argparse()
# Start session
os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.GPU_ID... | en | 0.760881 | # Load config # Start session # Data files # Inputs and model # Load snapshot # decay doesn't matter # Write results # Run test # compute accuracy | 1.956343 | 2 |
extract_gear/armor_visitor.py | kamerons/dde-extract-gear | 0 | 3875 | <filename>extract_gear/armor_visitor.py
class ArmorVisitor:
def __init__(self, num_pages, first_page_col_start, first_page_row_start,
last_page_row_start, last_page_col_end, last_page_row_end, num_col_page=5, num_row_page=3):
self.num_pages = num_pages
self.first_page_col_start = first_page_col_start
... | <filename>extract_gear/armor_visitor.py
class ArmorVisitor:
def __init__(self, num_pages, first_page_col_start, first_page_row_start,
last_page_row_start, last_page_col_end, last_page_row_end, num_col_page=5, num_row_page=3):
self.num_pages = num_pages
self.first_page_col_start = first_page_col_start
... | none | 1 | 2.839754 | 3 | |
gamla/url_utils_test.py | hyroai/gamla | 17 | 3876 | <filename>gamla/url_utils_test.py
from gamla import url_utils
def test_add_to_query_string1():
assert (
url_utils.add_to_query_string(
{"a": 123},
"https://www.domain.com/path?param1=param1#anchor",
)
== "https://www.domain.com/path?param1=param1&a=123#anchor"
)... | <filename>gamla/url_utils_test.py
from gamla import url_utils
def test_add_to_query_string1():
assert (
url_utils.add_to_query_string(
{"a": 123},
"https://www.domain.com/path?param1=param1#anchor",
)
== "https://www.domain.com/path?param1=param1&a=123#anchor"
)... | en | 0.579048 | #anchor", #anchor" #anchor", #anchor" | 2.848208 | 3 |
examples/temp_feie_shetland.py | nilsmkMET/roppy | 0 | 3877 | import numpy as np
from netCDF4 import Dataset
# Import development version of roppy
import sys
sys.path = ['..'] + sys.path
import roppy
# --- EDIT -----------------
# ROMS file
romsfile = 'data/ocean_avg_example.nc'
# Section definition
lon0, lat0 = -0.67, 60.75 # Shetland
lon1, lat1 = 4.72, 60.75 # Feie
# --... | import numpy as np
from netCDF4 import Dataset
# Import development version of roppy
import sys
sys.path = ['..'] + sys.path
import roppy
# --- EDIT -----------------
# ROMS file
romsfile = 'data/ocean_avg_example.nc'
# Section definition
lon0, lat0 = -0.67, 60.75 # Shetland
lon1, lat1 = 4.72, 60.75 # Feie
# --... | en | 0.728539 | # Import development version of roppy # --- EDIT ----------------- # ROMS file # Section definition # Shetland # Feie # --- EDIT ------------------ # Make a grid object # Get grid coordinates of end points # Find nearest rho-points # Make a Section object # Read in a 3D temperature field # Interpolate to the section # ... | 2.660592 | 3 |
examples/test_scalar_field.py | gemini3d/pv-gemini | 0 | 3878 | #!/usr/bin/env python3
"""
example of 3D scalar field
If you get this error, ParaView doesn't know your data file format:
TypeError: TestFileReadability argument %Id: %V
"""
from pathlib import Path
import argparse
import paraview.simple as pvs
p = argparse.ArgumentParser()
p.add_argument("fn", help="data file to l... | #!/usr/bin/env python3
"""
example of 3D scalar field
If you get this error, ParaView doesn't know your data file format:
TypeError: TestFileReadability argument %Id: %V
"""
from pathlib import Path
import argparse
import paraview.simple as pvs
p = argparse.ArgumentParser()
p.add_argument("fn", help="data file to l... | en | 0.505949 | #!/usr/bin/env python3 example of 3D scalar field If you get this error, ParaView doesn't know your data file format: TypeError: TestFileReadability argument %Id: %V | 2.674977 | 3 |
src/cms/forms/languages/language_form.py | S10MC2015/cms-django | 0 | 3879 | <filename>src/cms/forms/languages/language_form.py
from django import forms
from ...models import Language
class LanguageForm(forms.ModelForm):
"""
Form for creating and modifying language objects
"""
class Meta:
model = Language
fields = [
"code",
"english_na... | <filename>src/cms/forms/languages/language_form.py
from django import forms
from ...models import Language
class LanguageForm(forms.ModelForm):
"""
Form for creating and modifying language objects
"""
class Meta:
model = Language
fields = [
"code",
"english_na... | en | 0.887567 | Form for creating and modifying language objects | 2.103367 | 2 |
search/forms.py | gregneagle/sal | 2 | 3880 | from django import forms
from .models import *
from server.models import *
class ChoiceFieldNoValidation(forms.ChoiceField):
def validate(self, value):
pass
class SaveSearchForm(forms.ModelForm):
class Meta:
model = SavedSearch
fields = ('name',)
class SearchRowForm(forms.ModelForm):... | from django import forms
from .models import *
from server.models import *
class ChoiceFieldNoValidation(forms.ChoiceField):
def validate(self, value):
pass
class SaveSearchForm(forms.ModelForm):
class Meta:
model = SavedSearch
fields = ('name',)
class SearchRowForm(forms.ModelForm):... | none | 1 | 2.307694 | 2 | |
newsparser.py | antoreep-jana/BBC-News-Analyzer | 1 | 3881 | <reponame>antoreep-jana/BBC-News-Analyzer
from bs4 import BeautifulSoup as bs
import requests
class BBC:
def __init__(self, url:str):
article = requests.get(url)
self.soup = bs(article.content, "html.parser")
#print(dir(self.soup))
#print(self.soup.h1.text)
self.body = self... | from bs4 import BeautifulSoup as bs
import requests
class BBC:
def __init__(self, url:str):
article = requests.get(url)
self.soup = bs(article.content, "html.parser")
#print(dir(self.soup))
#print(self.soup.h1.text)
self.body = self.get_body()
self.link = url
... | en | 0.075553 | #print(dir(self.soup)) #print(self.soup.h1.text) #author = self.soup.find #date = self.soup #for img in imgs: # print(img['src']) #for para in paras: # print(para.text) #body = self.soup.find(property="articleBody") #for para in paras: # print(para.text) #return [p.text for p in body.find_all("p")] #return self.soup.fi... | 3.070668 | 3 |
SIR_model-Copy.Caroline.1.py | Caroline-Odevall/final-project-team-18 | 0 | 3882 | # In[42]:
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt
# In[43]:
# describe the model
def deriv(y, t, N, beta, gamma, delta):
S, E, I, R = y
dSdt = -beta * S * I / N # S(t) – susceptible (de som är mottagliga för infektion).
dEdt = beta * S * I / N - gamma * ... | # In[42]:
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt
# In[43]:
# describe the model
def deriv(y, t, N, beta, gamma, delta):
S, E, I, R = y
dSdt = -beta * S * I / N # S(t) – susceptible (de som är mottagliga för infektion).
dEdt = beta * S * I / N - gamma * ... | sv | 0.386597 | # In[42]: # In[43]: # describe the model # S(t) – susceptible (de som är mottagliga för infektion). # I(t) – infected (de som har pågående infektion) # In[44]: # describe the parameters #Totala befolkningen N=s(t)+I(t)+R(t) #infections last four days #Reoval rate (Hur många som tillfrisknar) #incubation period of f... | 2.847142 | 3 |
Condicionales anidados.py | gcardosov/PythonAprendeOrg | 1 | 3883 | pregunta = input('trabajas desde casa? ')
if pregunta == True:
print 'Eres afortunado'
if pregunta == False:
print 'Trabajas fuera de casa'
tiempo = input('Cuantos minutos haces al trabajo: ')
if tiempo == 0:
print 'trabajas desde casa'
elif tiempo <=20:
print 'Es po... | pregunta = input('trabajas desde casa? ')
if pregunta == True:
print 'Eres afortunado'
if pregunta == False:
print 'Trabajas fuera de casa'
tiempo = input('Cuantos minutos haces al trabajo: ')
if tiempo == 0:
print 'trabajas desde casa'
elif tiempo <=20:
print 'Es po... | none | 1 | 3.919037 | 4 | |
app/middleware/cache_headers.py | Niclnx/service-stac | 9 | 3884 | <gh_stars>1-10
import logging
import re
from urllib.parse import urlparse
from django.conf import settings
from django.utils.cache import add_never_cache_headers
from django.utils.cache import patch_cache_control
from django.utils.cache import patch_response_headers
logger = logging.getLogger(__name__)
STAC_BASE = s... | import logging
import re
from urllib.parse import urlparse
from django.conf import settings
from django.utils.cache import add_never_cache_headers
from django.utils.cache import patch_cache_control
from django.utils.cache import patch_response_headers
logger = logging.getLogger(__name__)
STAC_BASE = settings.STAC_BA... | en | 0.838707 | Middleware that adds appropriate cache headers to GET and HEAD methods. NOTE: /checker, /get-token, /metrics and /{healthcheck} endpoints are marked as never cache. # Code to be executed for each request before # the view (and later middleware) are called. # Code to be executed for each request/response after # th... | 2.202202 | 2 |
mmdet/models/detectors/knowledge_distilling/kd_single_stage.py | anorthman/mmdetection | 5 | 3885 | <filename>mmdet/models/detectors/knowledge_distilling/kd_single_stage.py
# author huangchuanhong
import torch
from mmcv.runner import load_checkpoint
from ..base import BaseDetector
from ..single_stage import SingleStageDetector
from ...registry import DETECTORS
from ...builder import build_detector
@DETECTORS.regist... | <filename>mmdet/models/detectors/knowledge_distilling/kd_single_stage.py
# author huangchuanhong
import torch
from mmcv.runner import load_checkpoint
from ..base import BaseDetector
from ..single_stage import SingleStageDetector
from ...registry import DETECTORS
from ...builder import build_detector
@DETECTORS.regist... | en | 0.570384 | # author huangchuanhong | 1.749287 | 2 |
metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py | yiwc/robotics-world | 681 | 3886 | <gh_stars>100-1000
import numpy as np
from gym.spaces import Box
from metaworld.envs import reward_utils
from metaworld.envs.asset_path_utils import full_v2_path_for
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerDialTurnEnvV2(SawyerXYZEnv):
TARGET_RADIU... | import numpy as np
from gym.spaces import Box
from metaworld.envs import reward_utils
from metaworld.envs.asset_path_utils import full_v2_path_for
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerDialTurnEnvV2(SawyerXYZEnv):
TARGET_RADIUS = 0.07
def _... | none | 1 | 1.985433 | 2 | |
yezdi/parser/parser.py | ragsagar/yezdi | 1 | 3887 | from yezdi.lexer.token import TokenType
from yezdi.parser.ast import Program, Statement, Participant, Title, LineStatement
class Parser:
def __init__(self, lexer):
self.lexer = lexer
self.current_token = None
self.peek_token = None
self.next_token()
self.next_token()
... | from yezdi.lexer.token import TokenType
from yezdi.parser.ast import Program, Statement, Participant, Title, LineStatement
class Parser:
def __init__(self, lexer):
self.lexer = lexer
self.current_token = None
self.peek_token = None
self.next_token()
self.next_token()
... | none | 1 | 2.512785 | 3 | |
scripts/check_categories.py | oberron/entolusis | 0 | 3888 | # list categories in category folder
from os import walk
from os.path import abspath,join, pardir
categories_folder = abspath(join(__file__,pardir,pardir,"category"))
post_folder = abspath(join(__file__,pardir,pardir,"_posts"))
site_categories = []
for root,directories,files in walk(categories_folder):
for f in ... | # list categories in category folder
from os import walk
from os.path import abspath,join, pardir
categories_folder = abspath(join(__file__,pardir,pardir,"category"))
post_folder = abspath(join(__file__,pardir,pardir,"_posts"))
site_categories = []
for root,directories,files in walk(categories_folder):
for f in ... | en | 0.533285 | # list categories in category folder | 2.960715 | 3 |
docsrc/makedoc.py | syoyo/soloud | 1 | 3889 | <reponame>syoyo/soloud<filename>docsrc/makedoc.py
#!/usr/bin/env python3
""" builds documentation files from multimarkdown (mmd) source
to various formats, including the web site and pdf.
"""
import subprocess
import glob
import os
import sys
import time
import shutil
src = [
"intro.mmd",
"downloads.mmd"... | #!/usr/bin/env python3
""" builds documentation files from multimarkdown (mmd) source
to various formats, including the web site and pdf.
"""
import subprocess
import glob
import os
import sys
import time
import shutil
src = [
"intro.mmd",
"downloads.mmd",
"quickstart.mmd",
"faq.mmd",
"dirstr... | en | 0.723567 | #!/usr/bin/env python3 builds documentation files from multimarkdown (mmd) source to various formats, including the web site and pdf. | 2.004581 | 2 |
arch/api/base/utils/party.py | yzjba/FATE | 32 | 3890 | <filename>arch/api/base/utils/party.py
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | <filename>arch/api/base/utils/party.py
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | en | 0.847659 | # # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 2.214879 | 2 |
src/sentry/options/defaults.py | faulkner/sentry | 0 | 3891 | """
sentry.options.defaults
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from sentry.logging import LoggingFormat
from sentry.options import (
FLAG_IMMUTAB... | """
sentry.options.defaults
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from sentry.logging import LoggingFormat
from sentry.options import (
FLAG_IMMUTAB... | en | 0.363841 | sentry.options.defaults ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. # Cache # register('cache.backend', flags=FLAG_NOSTORE) # register('cache.options', type=Dict, flags=FLAG_NOSTORE) # System # register('system.debug',... | 1.586748 | 2 |
tools/unidatadownload.py | henryiii/backrefs | 0 | 3892 | """Download `Unicodedata` files."""
from __future__ import unicode_literals
import os
import zipfile
import codecs
from urllib.request import urlopen
__version__ = '2.2.0'
HOME = os.path.dirname(os.path.abspath(__file__))
def zip_unicode(output, version):
"""Zip the Unicode files."""
zipper = zipfile.ZipFi... | """Download `Unicodedata` files."""
from __future__ import unicode_literals
import os
import zipfile
import codecs
from urllib.request import urlopen
__version__ = '2.2.0'
HOME = os.path.dirname(os.path.abspath(__file__))
def zip_unicode(output, version):
"""Zip the Unicode files."""
zipper = zipfile.ZipFi... | en | 0.68088 | Download `Unicodedata` files. Zip the Unicode files. Unzip the Unicode files. # Do I need backslash on windows? Or is it forward as well? Download Unicode data scripts and blocks. Ensure we have Unicode data to generate Unicode tables. # Download missing files if any. Zip if required. | 3.372841 | 3 |
generator/cache/cache.py | biarmic/OpenCache | 5 | 3893 | # See LICENSE for licensing information.
#
# Copyright (c) 2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import debug
import datetime
from policy import assoc... | # See LICENSE for licensing information.
#
# Copyright (c) 2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import debug
import datetime
from policy import assoc... | en | 0.813062 | # See LICENSE for licensing information. # # Copyright (c) 2021 Regents of the University of California and The Board # of Regents for the Oklahoma Agricultural and Mechanical College # (acting for and on behalf of Oklahoma State University) # All rights reserved. # This is not a design module, but contains a cache des... | 2.269 | 2 |
utils/data_loader.py | elieser1101/loglizer | 0 | 3894 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
import pandas as pd
import os
import numpy as np
def hdfs_data_loader(para):
""" load the log sequence matrix and labels from the file path.
Args:
--------
para: the parameters dictionary
Returns:
--------
raw_data: log sequenc... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
import pandas as pd
import os
import numpy as np
def hdfs_data_loader(para):
""" load the log sequence matrix and labels from the file path.
Args:
--------
para: the parameters dictionary
Returns:
--------
raw_data: log sequences matrix
l... | en | 0.647954 | #!/usr/bin/env python # -*- coding: utf-8 -*- load the log sequence matrix and labels from the file path. Args: -------- para: the parameters dictionary Returns: -------- raw_data: log sequences matrix label_data: labels matrix # load log sequence matrix # remove the last column of block name # load lables # ... | 2.891343 | 3 |
aspx2url/aspx2url.py | marcocucinato/aspx2url | 0 | 3895 | <reponame>marcocucinato/aspx2url<filename>aspx2url/aspx2url.py
from __future__ import print_function
import re, sys, glob, getopt, os
def usage():
print('aspx2url v1.0')
print('Usage:')
print(sys.argv[0]+' -d -h filename(s)')
print('-d : Delete original file')
print('-h : This help')
def main():
... | from __future__ import print_function
import re, sys, glob, getopt, os
def usage():
print('aspx2url v1.0')
print('Usage:')
print(sys.argv[0]+' -d -h filename(s)')
print('-d : Delete original file')
print('-h : This help')
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hd")... | none | 1 | 2.694583 | 3 | |
pytype/tests/py2/test_stdlib.py | souravbadami/pytype | 1 | 3896 | <reponame>souravbadami/pytype
"""Tests of selected stdlib functions."""
from pytype.tests import test_base
class StdlibTests(test_base.TargetPython27FeatureTest):
"""Tests for files in typeshed/stdlib."""
def testPosix(self):
ty = self.Infer("""
import posix
x = posix.urandom(10)
""")
se... | """Tests of selected stdlib functions."""
from pytype.tests import test_base
class StdlibTests(test_base.TargetPython27FeatureTest):
"""Tests for files in typeshed/stdlib."""
def testPosix(self):
ty = self.Infer("""
import posix
x = posix.urandom(10)
""")
self.assertTypesMatchPytd(ty, ""... | en | 0.389229 | Tests of selected stdlib functions. Tests for files in typeshed/stdlib. import posix x = posix.urandom(10) posix = ... # type: module x = ... # type: str import random random.sample(xrange(10), 5) import types if isinstance("", types.StringTypes): x = 42 if isinstance(False, type... | 2.505379 | 3 |
smmips/__init__.py | oicr-gsi/pysmmips | 0 | 3897 | <reponame>oicr-gsi/pysmmips
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 16:04:52 2020
@author: rjovelin
"""
| # -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 16:04:52 2020
@author: rjovelin
""" | en | 0.771384 | # -*- coding: utf-8 -*- Created on Tue Oct 20 16:04:52 2020 @author: rjovelin | 0.986295 | 1 |
tarentsocialwall/MongoDBClient.py | tarent/socialwall-backend | 0 | 3898 | <filename>tarentsocialwall/MongoDBClient.py
import random
from datetime import datetime
from passlib.handlers.sha2_crypt import sha256_crypt
from pymongo import MongoClient
from pymongo.errors import ConnectionFailure
from tarentsocialwall.SocialPost import SocialPost
from tarentsocialwall.User import User
from taren... | <filename>tarentsocialwall/MongoDBClient.py
import random
from datetime import datetime
from passlib.handlers.sha2_crypt import sha256_crypt
from pymongo import MongoClient
from pymongo.errors import ConnectionFailure
from tarentsocialwall.SocialPost import SocialPost
from tarentsocialwall.User import User
from taren... | en | 0.844269 | Static access method. # connect to MongoDB, change the << MONGODB URL >> to reflect your own connection string # The ismaster command is cheap and does not require auth. # write social_post into mongo # read random social_post from list # when we went through all posts once we reset counter and shuffle list # so we don... | 2.491196 | 2 |
src/mount_efs/__init__.py | Sodki/efs-utils | 0 | 3899 | #!/usr/bin/env python
#
# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
#
# Copy this script to /sbin/mount.efs and make sur... | #!/usr/bin/env python
#
# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
#
# Copy this script to /sbin/mount.efs and make sur... | en | 0.834586 | #!/usr/bin/env python # # Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. # # Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. # # # Copy this script to /sbin/mount.efs and make sur... | 1.988797 | 2 |