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 |
|---|---|---|---|---|---|---|---|---|---|---|
exporters/contrib/writers/odo_writer.py | scrapinghub/exporters | 41 | 2300 | import six
import json
import gzip
from exporters.default_retries import retry_long
from exporters.writers.base_writer import BaseWriter
class ODOWriter(BaseWriter):
"""
Writes items to a odo destination. https://odo.readthedocs.org/en/latest/
Needed parameters:
- schema (object)
sc... | import six
import json
import gzip
from exporters.default_retries import retry_long
from exporters.writers.base_writer import BaseWriter
class ODOWriter(BaseWriter):
"""
Writes items to a odo destination. https://odo.readthedocs.org/en/latest/
Needed parameters:
- schema (object)
sc... | en | 0.429439 | Writes items to a odo destination. https://odo.readthedocs.org/en/latest/ Needed parameters: - schema (object) schema object. - odo_uri (str) ODO valid destination uri. | 2.408809 | 2 |
x7/geom/needs_test.py | gribbg/x7-geom | 0 | 2301 | <reponame>gribbg/x7-geom
"""
Simple file to validate that maketests is working. Call maketests via:
>>> from x7.shell import *; maketests('x7.sample.needs_tests')
"""
def needs_a_test(a, b):
return a+b
| """
Simple file to validate that maketests is working. Call maketests via:
>>> from x7.shell import *; maketests('x7.sample.needs_tests')
"""
def needs_a_test(a, b):
return a+b | en | 0.89101 | Simple file to validate that maketests is working. Call maketests via: >>> from x7.shell import *; maketests('x7.sample.needs_tests') | 1.584453 | 2 |
python/SHA3_hashlib_based_concept.py | feketebv/SCA_proof_SHA3-512 | 1 | 2302 | '''
Written by: <NAME> <EMAIL> <EMAIL>
Last updated: 29.01.2021
'''
# the concept is to generate a side channel resistant initialisation of the hashing function based on
# one secret key and several openly known initialisation vectors (IV) in a manner that the same input
# is not hashed too more than two times,... | '''
Written by: <NAME> <EMAIL> <EMAIL>
Last updated: 29.01.2021
'''
# the concept is to generate a side channel resistant initialisation of the hashing function based on
# one secret key and several openly known initialisation vectors (IV) in a manner that the same input
# is not hashed too more than two times,... | en | 0.883962 | Written by: <NAME> <EMAIL> <EMAIL>
Last updated: 29.01.2021 # the concept is to generate a side channel resistant initialisation of the hashing function based on # one secret key and several openly known initialisation vectors (IV) in a manner that the same input # is not hashed too more than two times, which is hopef... | 2.936338 | 3 |
graphstar/utils.py | pengboomouch/graphstar | 0 | 2303 | """
graphstar.utils
~~~~~~~~~~~~~~~
<NAME>
A simple bedirectional graph with A* and breadth-first pathfinding.
Utils are either used by the search algorithm, or when needed :)
Pretty self explainatory (I hope)
For more information see the examples and tests folder
"""
def smooth_path(p):
# If the path is o... | """
graphstar.utils
~~~~~~~~~~~~~~~
<NAME>
A simple bedirectional graph with A* and breadth-first pathfinding.
Utils are either used by the search algorithm, or when needed :)
Pretty self explainatory (I hope)
For more information see the examples and tests folder
"""
def smooth_path(p):
# If the path is o... | en | 0.836058 | graphstar.utils ~~~~~~~~~~~~~~~ <NAME> A simple bedirectional graph with A* and breadth-first pathfinding. Utils are either used by the search algorithm, or when needed :) Pretty self explainatory (I hope) For more information see the examples and tests folder # If the path is only two nodes long, then # we ca... | 3.595523 | 4 |
design_patterns/pubsub/simple_events/__init__.py | JASTYN/pythonmaster | 3 | 2304 | <filename>design_patterns/pubsub/simple_events/__init__.py
class Event:
def __init__(self):
self.handlers = set()
def subscribe(self, func):
self.handlers.add(func)
def unsubscribe(self, func):
self.handlers.remove(func)
def emit(self, *args):
for func in self.handlers... | <filename>design_patterns/pubsub/simple_events/__init__.py
class Event:
def __init__(self):
self.handlers = set()
def subscribe(self, func):
self.handlers.add(func)
def unsubscribe(self, func):
self.handlers.remove(func)
def emit(self, *args):
for func in self.handlers... | none | 1 | 2.669191 | 3 | |
jinchi/demo/foobar.py | jiz148/py-test | 0 | 2305 | import os
def check_env(env_var_name):
"""
Check and return the type of an environment variable.
supported types:
None
Integer
String
@param env_var_name: environment variable name
@return: string of the type name.
"""
try:
val = os.getenv(env_var_name)
... | import os
def check_env(env_var_name):
"""
Check and return the type of an environment variable.
supported types:
None
Integer
String
@param env_var_name: environment variable name
@return: string of the type name.
"""
try:
val = os.getenv(env_var_name)
... | en | 0.519426 | Check and return the type of an environment variable. supported types: None Integer String @param env_var_name: environment variable name @return: string of the type name. | 3.476828 | 3 |
sound/serializers.py | Anirudhchoudhary/ApnaGanna__backend | 0 | 2306 | from .models import Sound , Album
from rest_framework import serializers
class SoundSerializer(serializers.ModelSerializer):
class Meta:
model = Sound
fields = ["name" , "song_image" , "pk" , "like" , "played" , "tag" , "singer" , "upload_date"]
class SoundDetailSerializer(seriali... | from .models import Sound , Album
from rest_framework import serializers
class SoundSerializer(serializers.ModelSerializer):
class Meta:
model = Sound
fields = ["name" , "song_image" , "pk" , "like" , "played" , "tag" , "singer" , "upload_date"]
class SoundDetailSerializer(seriali... | none | 1 | 2.545568 | 3 | |
tracking/utils.py | WGBH/django-tracking | 0 | 2307 | from datetime import datetime
from django.conf import settings
import pytz
def check_tracker(obj, simple=True):
if simple:
if obj.status > 0:
return True
return False
# we have a gatekeeper
now = datetime.now(pytz.utc)
if obj.tracker_publish_status < 0:
... | from datetime import datetime
from django.conf import settings
import pytz
def check_tracker(obj, simple=True):
if simple:
if obj.status > 0:
return True
return False
# we have a gatekeeper
now = datetime.now(pytz.utc)
if obj.tracker_publish_status < 0:
... | en | 0.859824 | # we have a gatekeeper # Checking live_as_of ... # is live_as_of set? # No live_as_of --- bail # has it happened yet? # live_as_of --- not yet! # is there an expiration date? # EXPIRED! # it's OK then This creates the dropdown in the Admin for where to put each tracker. It defaults to the obvious 4 location (top/bo... | 2.557626 | 3 |
devtools/api/health.py | ankeshkhemani/devtools | 0 | 2308 | import datetime
from fastapi import APIRouter
router = APIRouter()
@router.get("", tags=["health"])
async def get_health():
return {
"results": [],
"status": "success",
"timestamp": datetime.datetime.now().timestamp()
}
| import datetime
from fastapi import APIRouter
router = APIRouter()
@router.get("", tags=["health"])
async def get_health():
return {
"results": [],
"status": "success",
"timestamp": datetime.datetime.now().timestamp()
}
| none | 1 | 2.540162 | 3 | |
computation/Tests/Jetson/TF_model.py | y-x-c/Heliot | 4 | 2309 | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from distutils.version import StrictVersion
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
import json
import time
im... | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from distutils.version import StrictVersion
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
import json
import time
im... | en | 0.475657 | # Load the labels #Load categories # Load image size #print(reqsize) #image_filename = '../data/' + 'image1.jpg' #.astype(numpy.float32) #img values are scaled from -1 to 1 #model output layer name #print(all_tensor_names) #Demo run, so that graph is loaded into TF memory # Run inference #print(output_dict) | 2.287583 | 2 |
frappe/patches/v13_0/update_date_filters_in_user_settings.py | chentaoz/frappe | 3 | 2310 | from __future__ import unicode_literals
import frappe, json
from frappe.model.utils.user_settings import update_user_settings, sync_user_settings
def execute():
users = frappe.db.sql("select distinct(user) from `__UserSettings`", as_dict=True)
for user in users:
user_settings = frappe.db.sql('''
select
* f... | from __future__ import unicode_literals
import frappe, json
from frappe.model.utils.user_settings import update_user_settings, sync_user_settings
def execute():
users = frappe.db.sql("select distinct(user) from `__UserSettings`", as_dict=True)
for user in users:
user_settings = frappe.db.sql('''
select
* f... | en | 0.532604 | select * from `__UserSettings` where user="{user}" | 2.113893 | 2 |
miniproject/train.py | peguerosdc/ml4phy-quantum-oscillators | 0 | 2311 | import BoltzmannMachine as bm
import QHO as qho
import numpy as np
import datetime
# Visualization imports
from IPython.display import clear_output
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['figure.dpi']=300
def sigmoid(x):
return .5 * (1 + np.tanh(x / 2.))
# Set t... | import BoltzmannMachine as bm
import QHO as qho
import numpy as np
import datetime
# Visualization imports
from IPython.display import clear_output
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['figure.dpi']=300
def sigmoid(x):
return .5 * (1 + np.tanh(x / 2.))
# Set t... | en | 0.896576 | # Visualization imports # Set the quantum gas with N particles, a limit of 10 for the # quantum numbers and default temperature and frequency # the amount of hidden units was set by trial and error # the recipe suggests to set the batchsize to 10, though it can range # from 10 to 100 # the recipe suggests a learning ra... | 2.831656 | 3 |
Tests/Marketplace/prepare_public_index_for_private_testing.py | diCagri/content | 799 | 2312 | import time
import os
import sys
import shutil
import json
import argparse
from zipfile import ZipFile
from contextlib import contextmanager
from datetime import datetime
from Tests.private_build.upload_packs_private import download_and_extract_index, update_index_with_priced_packs, \
extract_packs_artifacts
from T... | import time
import os
import sys
import shutil
import json
import argparse
from zipfile import ZipFile
from contextlib import contextmanager
from datetime import datetime
from Tests.private_build.upload_packs_private import download_and_extract_index, update_index_with_priced_packs, \
extract_packs_artifacts
from T... | en | 0.784416 | Upload updated index zip to cloud storage. Args: public_index_folder_path (str): public index folder full path. extract_destination_path (str): extract folder full path. public_ci_dummy_index_blob (Blob): google cloud storage object that represents the dummy index.zip blob. build_nu... | 2.03504 | 2 |
ARMODServers/Apps/ARExperiences/apps.py | Phantomxm2021/ARMOD-Dashboard | 1 | 2313 | from django.apps import AppConfig
class ArexperiencesConfig(AppConfig):
name = 'Apps.ARExperiences'
| from django.apps import AppConfig
class ArexperiencesConfig(AppConfig):
name = 'Apps.ARExperiences'
| none | 1 | 1.146602 | 1 | |
configs/_base_/datasets/flyingchairs_320x448.py | zhouzaida/mmflow | 1 | 2314 | <filename>configs/_base_/datasets/flyingchairs_320x448.py<gh_stars>1-10
dataset_type = 'FlyingChairs'
data_root = 'data/FlyingChairs_release'
img_norm_cfg = dict(mean=[0., 0., 0.], std=[255., 255., 255.], to_rgb=False)
global_transform = dict(
translates=(0.05, 0.05),
zoom=(1.0, 1.5),
shear=(0.86, 1.16),
... | <filename>configs/_base_/datasets/flyingchairs_320x448.py<gh_stars>1-10
dataset_type = 'FlyingChairs'
data_root = 'data/FlyingChairs_release'
img_norm_cfg = dict(mean=[0., 0., 0.], std=[255., 255., 255.], to_rgb=False)
global_transform = dict(
translates=(0.05, 0.05),
zoom=(1.0, 1.5),
shear=(0.86, 1.16),
... | none | 1 | 1.764176 | 2 | |
plaidml2/edsl/__init__.py | ZhouXiaolin/plaidml | 4,535 | 2315 | <gh_stars>1000+
# Copyright 2019 Intel Corporation.
import logging
from collections import namedtuple
import numpy as np
import six
from plaidml2 import DType
from plaidml2.core import TensorShape, Buffer
from plaidml2.ffi import ForeignObject, ffi, ffi_call, lib
logger = logging.getLogger(__name__)
def __init():... | # Copyright 2019 Intel Corporation.
import logging
from collections import namedtuple
import numpy as np
import six
from plaidml2 import DType
from plaidml2.core import TensorShape, Buffer
from plaidml2.ffi import ForeignObject, ffi, ffi_call, lib
logger = logging.getLogger(__name__)
def __init():
"""Docstrin... | en | 0.712151 | # Copyright 2019 Intel Corporation. Docstring for function plaidml2.edsl.__init Docstring for class LogicalShape Returns the dimensions of a LogicalShape as a list. Args: self (pointer): The object pointer for a LogicalShape Returns: list (int): Integer dimensions of the Logica... | 2.171575 | 2 |
pytorch_toolkit/face_recognition/model/common.py | AnastasiaaSenina/openvino_training_extensions | 1 | 2316 | <reponame>AnastasiaaSenina/openvino_training_extensions
"""
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | en | 0.850663 | Copyright (c) 2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so... | 1.585497 | 2 |
src/dataclay/util/logs.py | kpavel/pyclay | 1 | 2317 | <reponame>kpavel/pyclay
""" Class description goes here. """
import json
import logging
class JSONFormatter(logging.Formatter):
"""Simple JSON formatter for the logging facility."""
def format(self, obj):
"""Note that obj is a LogRecord instance."""
# Copy the dictionary
ret = dict(o... | """ Class description goes here. """
import json
import logging
class JSONFormatter(logging.Formatter):
"""Simple JSON formatter for the logging facility."""
def format(self, obj):
"""Note that obj is a LogRecord instance."""
# Copy the dictionary
ret = dict(obj.__dict__)
# P... | en | 0.782953 | Class description goes here. Simple JSON formatter for the logging facility. Note that obj is a LogRecord instance. # Copy the dictionary # Perform the message substitution # Exceptions must be formatted (they are not JSON-serializable # Dump the dictionary in JSON form | 3.356954 | 3 |
python/orthogonal_test.py | davxy/numeric | 2 | 2318 | <reponame>davxy/numeric<gh_stars>1-10
# Orthogonal linear system solver tests
from math import sqrt
import numpy as np
from orthogonal import orthogonal
################################################################################
# 2x2 orthogonal matrix
A = np.matrix('1 1;'
'1 -1', float)
A = A*1... | # Orthogonal linear system solver tests
from math import sqrt
import numpy as np
from orthogonal import orthogonal
################################################################################
# 2x2 orthogonal matrix
A = np.matrix('1 1;'
'1 -1', float)
A = A*1.0/sqrt(2.0)
# Known terms vector
b = ... | de | 0.463972 | # Orthogonal linear system solver tests ################################################################################ # 2x2 orthogonal matrix # Known terms vector # Solve the system # Check ################################################################################ # 2x2 orthogonal matrix # Known terms vector #... | 3.437702 | 3 |
src/autonlp/project.py | adbmd/autonlp | 1 | 2319 | import os
import shutil
from dataclasses import dataclass
from datetime import datetime
from typing import Dict, List, Optional
from huggingface_hub import Repository
from loguru import logger
from prettytable import PrettyTable
from .splits import TEST_SPLIT, TRAIN_SPLIT, VALID_SPLIT
from .tasks import TASKS
from .u... | import os
import shutil
from dataclasses import dataclass
from datetime import datetime
from typing import Dict, List, Optional
from huggingface_hub import Repository
from loguru import logger
from prettytable import PrettyTable
from .splits import TEST_SPLIT, TRAIN_SPLIT, VALID_SPLIT
from .tasks import TASKS
from .u... | en | 0.87677 | A training job in AutoNLP # {self.job_id}", A file uploaded to an AutoNLP project # {self.file_id})", An AutoNLP project Build a Project from the API response, JSON-encoded Update information about uploaded files and models attached to the project Uploads files to the project Starts training on the models # {self.proj_... | 2.295927 | 2 |
backend/services/apns_util.py | xuantan/viewfinder | 645 | 2320 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Apple Push Notification service utilities.
Original copyright for this code: https://github.com/jayridge/apnstornado
TokenToBinary(): converts a hex-encoded token into a binary value
CreateMessage(): formats a bin... | # -*- coding: utf-8 -*-
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Apple Push Notification service utilities.
Original copyright for this code: https://github.com/jayridge/apnstornado
TokenToBinary(): converts a hex-encoded token into a binary value
CreateMessage(): formats a binary APNs message fr... | en | 0.79598 | # -*- coding: utf-8 -*- # Copyright 2012 Viewfinder Inc. All Rights Reserved. Apple Push Notification service utilities. Original copyright for this code: https://github.com/jayridge/apnstornado TokenToBinary(): converts a hex-encoded token into a binary value CreateMessage(): formats a binary APNs message from p... | 2.454415 | 2 |
demonstrations/tutorial_kernels_module.py | jamesellis1999/qml | 216 | 2321 | r"""Training and evaluating quantum kernels
===========================================
.. meta::
:property="og:description": Kernels and alignment training with Pennylane.
:property="og:image": https://pennylane.ai/qml/_images/QEK_thumbnail.png
.. related::
tutorial_kernel_based_training Kernel-based tr... | r"""Training and evaluating quantum kernels
===========================================
.. meta::
:property="og:description": Kernels and alignment training with Pennylane.
:property="og:image": https://pennylane.ai/qml/_images/QEK_thumbnail.png
.. related::
tutorial_kernel_based_training Kernel-based tr... | en | 0.72662 | Training and evaluating quantum kernels =========================================== .. meta:: :property="og:description": Kernels and alignment training with Pennylane. :property="og:image": https://pennylane.ai/qml/_images/QEK_thumbnail.png .. related:: tutorial_kernel_based_training Kernel-based traini... | 3.88788 | 4 |
main.py | scottkaz/PyLoopover | 0 | 2322 | #!/usr/bin/python3
import pygame
import random
import time
##VARIABLES TO CHANGE
width = 500
height = 500
stats_height = 150
board_size = 5
window_name = "PyLoopover "+str(board_size)+"x"+str(board_size)
scramble_turns = 50
t_round = 3
FPS = 30
##DONT CHANGE THESE BOIS
WHITE = (255,255,255)
BLACK = (0,0,0)
GREEN = (3... | #!/usr/bin/python3
import pygame
import random
import time
##VARIABLES TO CHANGE
width = 500
height = 500
stats_height = 150
board_size = 5
window_name = "PyLoopover "+str(board_size)+"x"+str(board_size)
scramble_turns = 50
t_round = 3
FPS = 30
##DONT CHANGE THESE BOIS
WHITE = (255,255,255)
BLACK = (0,0,0)
GREEN = (3... | en | 0.592654 | #!/usr/bin/python3 ##VARIABLES TO CHANGE ##DONT CHANGE THESE BOIS #weird workaroud #name the window & size it. #setup framerate #setup event que #start with no events allowed #timer event #4 quitters #setup fonts #main l00p #eevveeentttss??? #a fresh canvas #draw stats #draw board #update da screeeeeen #end the game #g... | 3.134864 | 3 |
test3_05.py | yoojunwoong/python_review01 | 0 | 2323 | # for문에서 continue 사용하기, continue = skip개념!!!
for i in range(1,11):
if i == 6:
continue;
print(i);
print(i);
print(i);
print(i);
print(i);
| # for문에서 continue 사용하기, continue = skip개념!!!
for i in range(1,11):
if i == 6:
continue;
print(i);
print(i);
print(i);
print(i);
print(i);
| ko | 0.862307 | # for문에서 continue 사용하기, continue = skip개념!!! | 3.503958 | 4 |
csmpe/core_plugins/csm_install_operations/exr/package_lib.py | anushreejangid/csmpe-main | 0 | 2324 | <gh_stars>0
# =============================================================================
#
# Copyright (c) 2016, Cisco Systems
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistribution... | # =============================================================================
#
# Copyright (c) 2016, Cisco Systems
# 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 ... | en | 0.446435 | # ============================================================================= # # Copyright (c) 2016, Cisco Systems # 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 ... | 0.992508 | 1 |
megaboat.py | xros/megaboat | 4 | 2325 | <reponame>xros/megaboat
# -*- coding: utf-8 -*-
# Copyright to <NAME>.
# Any distrubites of this copy should inform its author. If for commercial, please inform the author for authentication. Apr 2014
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from lxml import etree
import time
import json
import urllib
im... | # -*- coding: utf-8 -*-
# Copyright to <NAME>.
# Any distrubites of this copy should inform its author. If for commercial, please inform the author for authentication. Apr 2014
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from lxml import etree
import time
import json
import urllib
import urllib2
# For media... | en | 0.426341 | # -*- coding: utf-8 -*- # Copyright to <NAME>. # Any distrubites of this copy should inform its author. If for commercial, please inform the author for authentication. Apr 2014 # For media posting Parsing Wechat messages for whose types are of : 'text', 'image', 'voice', 'video', 'location', 'link' After making a n... | 2.573917 | 3 |
root/converter/__init__.py | thasmarinho/root-image-editor | 2 | 2326 | from .color_converter import ColorConverter
from .scale_converter import ScaleConverter
| from .color_converter import ColorConverter
from .scale_converter import ScaleConverter
| none | 1 | 1.111166 | 1 | |
chirun/plastex/color/__init__.py | sthagen/chirun-ncl-chirun | 5 | 2327 | <filename>chirun/plastex/color/__init__.py
from plasTeX import Command, Environment
def ProcessOptions(options, document):
colors = {}
document.userdata.setPath('packages/color/colors', colors)
colors['red'] = latex2htmlcolor('1,0,0')
colors['green'] = latex2htmlcolor('0,1,0')
colors['blue'] = lat... | <filename>chirun/plastex/color/__init__.py
from plasTeX import Command, Environment
def ProcessOptions(options, document):
colors = {}
document.userdata.setPath('packages/color/colors', colors)
colors['red'] = latex2htmlcolor('1,0,0')
colors['green'] = latex2htmlcolor('0,1,0')
colors['blue'] = lat... | es | 0.12903 | # rgb # cmyk | 1.969568 | 2 |
ex035A11.py | gabrieleliasdev/python-cev | 0 | 2328 | <reponame>gabrieleliasdev/python-cev
print('\033[0;33;44mTeste\033[m')
print('\033[4;33;44mTeste\033[m')
print('\033[1;35;43mTeste\033[m')
print('\033[7;32;40mTeste\033[m')
print('\033[7;30mTeste\033[m')
print(" - - - Testando os 40 - - -")
print("\033[0;37;40mPreto\033[m")
print("\033[0;30;41mVermelho\033[m")
print("... | print('\033[0;33;44mTeste\033[m')
print('\033[4;33;44mTeste\033[m')
print('\033[1;35;43mTeste\033[m')
print('\033[7;32;40mTeste\033[m')
print('\033[7;30mTeste\033[m')
print(" - - - Testando os 40 - - -")
print("\033[0;37;40mPreto\033[m")
print("\033[0;30;41mVermelho\033[m")
print("\033[0;30;42mVerde\033[m")
print("\03... | none | 1 | 2.368265 | 2 | |
tg/release.py | TurboGears/tg2 | 812 | 2329 | """TurboGears project related information"""
version = "2.4.3"
description = "Next generation TurboGears"
long_description="""
TurboGears brings together a best of breed python tools
to create a flexible, full featured, and easy to use web
framework.
TurboGears 2 provides an integrated and well tested set of tools for... | """TurboGears project related information"""
version = "2.4.3"
description = "Next generation TurboGears"
long_description="""
TurboGears brings together a best of breed python tools
to create a flexible, full featured, and easy to use web
framework.
TurboGears 2 provides an integrated and well tested set of tools for... | en | 0.756567 | TurboGears project related information TurboGears brings together a best of breed python tools to create a flexible, full featured, and easy to use web framework. TurboGears 2 provides an integrated and well tested set of tools for everything you need to build dynamic, database driven applications. It provides a full ... | 1.82212 | 2 |
swm-master/swm-master/calc/mean_e_calc.py | m2lines/subgrid | 1 | 2330 | <filename>swm-master/swm-master/calc/mean_e_calc.py
## PRODUCE MEAN CALCULATIONS AND EXPORT AS .NPY
from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
import time as tictoc
from netCDF4 import Dataset... | <filename>swm-master/swm-master/calc/mean_e_calc.py
## PRODUCE MEAN CALCULATIONS AND EXPORT AS .NPY
from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
import time as tictoc
from netCDF4 import Dataset... | en | 0.552119 | ## PRODUCE MEAN CALCULATIONS AND EXPORT AS .NPY # change working directory # OPTIONS ## read data ## create ouputfolder ## U,V,H mean ## STORING | 2.320303 | 2 |
bogglesolver.py | gammazero/pybogglesolver | 0 | 2331 | <reponame>gammazero/pybogglesolver
"""
Module to generate solutions for Boggle grids.
<NAME> 22 Dec. 2009
"""
from __future__ import print_function
import os
import sys
import collections
import trie
if sys.version < '3':
range = xrange
class BoggleSolver(object):
"""
This class uses an external words ... | """
Module to generate solutions for Boggle grids.
<NAME> 22 Dec. 2009
"""
from __future__ import print_function
import os
import sys
import collections
import trie
if sys.version < '3':
range = xrange
class BoggleSolver(object):
"""
This class uses an external words file as a dictionary of acceptable ... | en | 0.861351 | Module to generate solutions for Boggle grids. <NAME> 22 Dec. 2009 This class uses an external words file as a dictionary of acceptable boggle words. When an instance of this class is created, it sets up an internal dictionary to look up valid boggle answers. The class' solve method can be used repeatedl... | 3.652987 | 4 |
tests/manage/monitoring/pagerduty/test_ceph.py | MeridianExplorer/ocs-ci | 0 | 2332 | <gh_stars>0
import logging
import pytest
from ocs_ci.framework.testlib import (
managed_service_required,
skipif_ms_consumer,
tier4,
tier4a,
)
from ocs_ci.ocs import constants
from ocs_ci.utility import pagerduty
log = logging.getLogger(__name__)
@tier4
@tier4a
@managed_service_required
@skipif_ms_... | import logging
import pytest
from ocs_ci.framework.testlib import (
managed_service_required,
skipif_ms_consumer,
tier4,
tier4a,
)
from ocs_ci.ocs import constants
from ocs_ci.utility import pagerduty
log = logging.getLogger(__name__)
@tier4
@tier4a
@managed_service_required
@skipif_ms_consumer
@py... | en | 0.946486 | Test that there is appropriate incident in PagerDuty when Placement group on one OSD is corrupted and that this incident is cleared when the corrupted ceph pool is removed. # get incidents from time when manager deployment was scaled down # TODO(fbalak): check the whole string in summary and incident alerts | 2.177174 | 2 |
STANchap7.py | phineas-pta/Bayesian-Methods-for-Hackers-using-PyStan | 1 | 2333 | # -*- coding: utf-8 -*-
import numpy as np, pandas as pd, arviz as az, prince, matplotlib.pyplot as plt, seaborn as sns
from cmdstanpy import CmdStanModel
#%% load data
data = pd.read_csv("data/overfitting.csv", index_col = 'case_id')
data.columns
data.info()
feature_names = data.columns.str.startswith("... | # -*- coding: utf-8 -*-
import numpy as np, pandas as pd, arviz as az, prince, matplotlib.pyplot as plt, seaborn as sns
from cmdstanpy import CmdStanModel
#%% load data
data = pd.read_csv("data/overfitting.csv", index_col = 'case_id')
data.columns
data.info()
feature_names = data.columns.str.startswith("... | en | 0.422353 | # -*- coding: utf-8 -*- #%% load data # weird column name #%% Roshan Sharma model # problem with JSON dump => cast to python native type data {
int N; // the number of training observations
int N2; // the number of test observations
int K; // the number of features
int y[N]; // the response
matrix[N,K] X... | 2.587737 | 3 |
watcher.py | factabulous/matgrindr | 1 | 2334 | # -*- coding: utf-8 -*-
import json
import threading
import os
import time
import mats
import sys
import requests
import traceback
import re
from util import debug, error
class MatsLoader(threading.Thread):
"""
Fire and forget loader for materials - will queue a 'mats' event or
an 'error' event if the lo... | # -*- coding: utf-8 -*-
import json
import threading
import os
import time
import mats
import sys
import requests
import traceback
import re
from util import debug, error
class MatsLoader(threading.Thread):
"""
Fire and forget loader for materials - will queue a 'mats' event or
an 'error' event if the lo... | en | 0.877242 | # -*- coding: utf-8 -*- Fire and forget loader for materials - will queue a 'mats' event or an 'error' event if the load fails. Automatically runs as a daemon filename is the file to async load queue is the queue to report the results into Fire and forget loader for materials - will queue a 'mats' event or... | 2.616405 | 3 |
luoxia/pipelines.py | pighui/luoxia | 2 | 2335 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
from scrapy import Request
from scrapy.pipelines.images import ImagesPipeline
from luoxia import settings
class L... | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
from scrapy import Request
from scrapy.pipelines.images import ImagesPipeline
from luoxia import settings
class L... | zh | 0.309389 | # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html # 将下载完成后的图片路径设置到item中 # 为每本书创建一个目录,存放她自己所有的图片 # 从连接中提取扩展名 # 返回的相对路径 | 2.790449 | 3 |
aws_sagemaker_studio/frameworks/tensorflow_mnist/mnist.py | jpmarques19/tensorflwo-test | 5 | 2336 | <reponame>jpmarques19/tensorflwo-test<filename>aws_sagemaker_studio/frameworks/tensorflow_mnist/mnist.py<gh_stars>1-10
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the L... | # Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | en | 0.811607 | # Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc... | 2.636426 | 3 |
common/util/autoware_debug_tools/scripts/stop_reason2pose.py | loop-perception/AutowareArchitectureProposal.iv | 12 | 2337 | #! /usr/bin/env python3
# Copyright 2020 Tier IV, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | #! /usr/bin/env python3
# Copyright 2020 Tier IV, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | en | 0.835173 | #! /usr/bin/env python3 # Copyright 2020 Tier IV, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law... | 2.189686 | 2 |
aiounittest/case.py | tmaila/aiounittest | 55 | 2338 | import asyncio
import unittest
from .helpers import async_test
class AsyncTestCase(unittest.TestCase):
''' AsyncTestCase allows to test asynchoronus function.
The usage is the same as :code:`unittest.TestCase`. It works with other test frameworks
and runners (eg. `pytest`, `nose`) as well.
AsyncTes... | import asyncio
import unittest
from .helpers import async_test
class AsyncTestCase(unittest.TestCase):
''' AsyncTestCase allows to test asynchoronus function.
The usage is the same as :code:`unittest.TestCase`. It works with other test frameworks
and runners (eg. `pytest`, `nose`) as well.
AsyncTes... | en | 0.688418 | AsyncTestCase allows to test asynchoronus function. The usage is the same as :code:`unittest.TestCase`. It works with other test frameworks and runners (eg. `pytest`, `nose`) as well. AsyncTestCase can run: - test of synchronous code (:code:`unittest.TestCase`) - test of asynchronous code... | 3.386886 | 3 |
US Flag.py | Code-Master1234/Turtle_Flags_File_Hub | 0 | 2339 | <reponame>Code-Master1234/Turtle_Flags_File_Hub<gh_stars>0
import turtle as t
def rectangle(horizontal, vertical, color):
t.pendown()
t.pensize(1)
t.color(color)
t.begin_fill()
for counter in range(2):
t.forward(horizontal)
t.right(90)
t.forward(vertical)
... | import turtle as t
def rectangle(horizontal, vertical, color):
t.pendown()
t.pensize(1)
t.color(color)
t.begin_fill()
for counter in range(2):
t.forward(horizontal)
t.right(90)
t.forward(vertical)
t.right(90)
t.end_fill()
t.penup()
def star(le... | none | 1 | 3.669107 | 4 | |
linked-list/delete_zero_sum_nodes.py | bryanlimy/technical-interview | 3 | 2340 | <reponame>bryanlimy/technical-interview<filename>linked-list/delete_zero_sum_nodes.py
# Given a linked list, remove consecutive nodes that sums up to zero
# https://www.careercup.com/question?id=5717797377146880
from util import *
def remove_zero_sum(head):
start = head
new = None
root = None
while st... | # Given a linked list, remove consecutive nodes that sums up to zero
# https://www.careercup.com/question?id=5717797377146880
from util import *
def remove_zero_sum(head):
start = head
new = None
root = None
while start:
end = start.next
total = start.value
zero = False
... | en | 0.787851 | # Given a linked list, remove consecutive nodes that sums up to zero # https://www.careercup.com/question?id=5717797377146880 | 3.779794 | 4 |
src/azure-cli/azure/cli/command_modules/maps/custom.py | psignoret/azure-cli | 1 | 2341 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | en | 0.390791 | # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------... | 2.284887 | 2 |
examples/wsdm2022/run_seqreco_B.py | Leavingseason/wsdm2022-seqrecsys | 0 | 2342 | import sys
import os
from tempfile import TemporaryDirectory
import numpy as np
import tensorflow.compat.v1 as tf
tf.get_logger().setLevel('ERROR') # only show error messages
from recommenders.utils.timer import Timer
from recommenders.utils.constants import SEED
from recommenders.models.deeprec.deeprec_utils import ... | import sys
import os
from tempfile import TemporaryDirectory
import numpy as np
import tensorflow.compat.v1 as tf
tf.get_logger().setLevel('ERROR') # only show error messages
from recommenders.utils.timer import Timer
from recommenders.utils.constants import SEED
from recommenders.models.deeprec.deeprec_utils import ... | en | 0.506964 | # only show error messages # from recommenders.models.deeprec.models.sequential.asvd import A2SVDModel as SeqModel # from recommenders.models.deeprec.models.sequential.caser import CaserModel as SeqModel # from recommenders.models.deeprec.models.sequential.gru4rec import GRU4RecModel as SeqModel # from recommenders.mod... | 1.745217 | 2 |
ctypesgen/ctypedescs.py | fgrie/ctypesgen | 0 | 2343 | #!/usr/bin/env python
"""
ctypesgen.ctypedescs contains classes to represent a C type. All of them
classes are subclasses of CtypesType.
Unlike in previous versions of ctypesgen, CtypesType and its subclasses are
completely independent of the parser module.
The most important method of CtypesType and its subclasses ... | #!/usr/bin/env python
"""
ctypesgen.ctypedescs contains classes to represent a C type. All of them
classes are subclasses of CtypesType.
Unlike in previous versions of ctypesgen, CtypesType and its subclasses are
completely independent of the parser module.
The most important method of CtypesType and its subclasses ... | en | 0.838784 | #!/usr/bin/env python ctypesgen.ctypedescs contains classes to represent a C type. All of them classes are subclasses of CtypesType. Unlike in previous versions of ctypesgen, CtypesType and its subclasses are completely independent of the parser module. The most important method of CtypesType and its subclasses is th... | 2.878603 | 3 |
pytouch/elements.py | Krai53n/pytouch | 0 | 2344 | <gh_stars>0
from random import randint
import pyxel
from constants import Screen
import cursors
class Text:
def __init__(self, text):
self._text = text
self._symbol_len = 3
self._padding_len = 1
def _count_text_len(self):
return (
self._symbol_len + self._padding... | from random import randint
import pyxel
from constants import Screen
import cursors
class Text:
def __init__(self, text):
self._text = text
self._symbol_len = 3
self._padding_len = 1
def _count_text_len(self):
return (
self._symbol_len + self._padding_len
... | none | 1 | 3.047503 | 3 | |
app/volume/admin_process.py | cleve/varidb | 0 | 2345 | <reponame>cleve/varidb<filename>app/volume/admin_process.py
from pulzarutils.utils import Utils
from pulzarutils.utils import Constants
from pulzarutils.messenger import Messenger
from pulzarcore.core_db import DB
class AdminProcess:
"""Handle admin operations from manage
"""
def __init__(self, logger):
... | from pulzarutils.utils import Utils
from pulzarutils.utils import Constants
from pulzarutils.messenger import Messenger
from pulzarcore.core_db import DB
class AdminProcess:
"""Handle admin operations from manage
"""
def __init__(self, logger):
self.TAG = self.__class__.__name__
self.logg... | en | 0.670506 | Handle admin operations from manage Get request type, checking for key value. # All nodes | 1.995862 | 2 |
tests/ssg_test_suite/profile.py | fduthilleul/scap-security-guide | 0 | 2346 | #!/usr/bin/env python2
from __future__ import print_function
import atexit
import logging
import sys
import ssg_test_suite.oscap
import ssg_test_suite.virt
from ssg_test_suite.rule import get_viable_profiles
from ssg_test_suite.virt import SnapshotStack
logging.getLogger(__name__).addHandler(logging.NullHandler())
... | #!/usr/bin/env python2
from __future__ import print_function
import atexit
import logging
import sys
import ssg_test_suite.oscap
import ssg_test_suite.virt
from ssg_test_suite.rule import get_viable_profiles
from ssg_test_suite.virt import SnapshotStack
logging.getLogger(__name__).addHandler(logging.NullHandler())
... | en | 0.887702 | #!/usr/bin/env python2 Perform profile check. Iterate over profiles in datastream and perform scanning of unaltered VM using every profile according to input. Also perform remediation run. Return value not defined, textual output and generated reports is the result. # depending on number of profiles w... | 2.022557 | 2 |
lib/wtforms/ext/appengine/fields.py | solidaritreebiz/Solidaritree | 43 | 2347 | <filename>lib/wtforms/ext/appengine/fields.py
import decimal
import operator
import warnings
from wtforms import fields, widgets
class ReferencePropertyField(fields.SelectFieldBase):
"""
A field for ``db.ReferenceProperty``. The list items are rendered in a
select.
:param reference_class:
A d... | <filename>lib/wtforms/ext/appengine/fields.py
import decimal
import operator
import warnings
from wtforms import fields, widgets
class ReferencePropertyField(fields.SelectFieldBase):
"""
A field for ``db.ReferenceProperty``. The list items are rendered in a
select.
:param reference_class:
A d... | en | 0.615473 | A field for ``db.ReferenceProperty``. The list items are rendered in a select. :param reference_class: A db.Model class which will be used to generate the default query to make the list of items. If this is not specified, The `query` property must be overridden before validation. :p... | 2.510001 | 3 |
mtrainsimulator.py | trevor-wieland/MTrainAI | 0 | 2348 | import mtrain
import numpy as np
import pandas as pd
import random
def simulate_games(num_players=4, domino_size=12, num_games=250, collect_data=True,
debug=False, players=["Random", "Greedy", "Probability", "Neural"],
file_name="PlayData/data4_12_250"):
"""
Runs the m... | import mtrain
import numpy as np
import pandas as pd
import random
def simulate_games(num_players=4, domino_size=12, num_games=250, collect_data=True,
debug=False, players=["Random", "Greedy", "Probability", "Neural"],
file_name="PlayData/data4_12_250"):
"""
Runs the m... | en | 0.919728 | Runs the mexican train game repeatedly with different combinations of players to generate data to be used in testing and training the neural net. If collect_data is on, the play data is retrieved and stored into a .xlsx file for later use The format for the file name for this is as follows: PlayData/d... | 3.429025 | 3 |
dml/errors.py | RGBCube/dml | 2 | 2349 | <reponame>RGBCube/dml
__all__ = ("DottedMarkupLanguageException", "DecodeError")
class DottedMarkupLanguageException(Exception):
"""Base class for all exceptions in this module."""
pass
class DecodeError(DottedMarkupLanguageException):
"""Raised when there is an error decoding a string."""
pass
| __all__ = ("DottedMarkupLanguageException", "DecodeError")
class DottedMarkupLanguageException(Exception):
"""Base class for all exceptions in this module."""
pass
class DecodeError(DottedMarkupLanguageException):
"""Raised when there is an error decoding a string."""
pass | en | 0.77319 | Base class for all exceptions in this module. Raised when there is an error decoding a string. | 2.581135 | 3 |
licenseplates/dataset.py | VaranRohila/apn | 0 | 2350 | ##############################################################################
#
# Below code is inspired on
# https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/datasets/pascal_voc.py
# --------------------------------------------------------
# Detectron2
# Licensed under the Apache 2.0 license... | ##############################################################################
#
# Below code is inspired on
# https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/datasets/pascal_voc.py
# --------------------------------------------------------
# Detectron2
# Licensed under the Apache 2.0 license... | en | 0.396339 | ############################################################################## # # Below code is inspired on # https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/datasets/pascal_voc.py # -------------------------------------------------------- # Detectron2 # Licensed under the Apache 2.0 license... | 2.264167 | 2 |
docs/examples/pytorch/resnet50/scripts/test_read_speed.py | RogerChern/DALI | 0 | 2351 | import glob
import time
import random
filelist = glob.glob('/mnt/lustre/chenyuntao1/datasets/imagenet/train/*/*')
random.shuffle(filelist)
begin = time.time()
for i, f in enumerate(filelist):
if i == 10000:
break
with open(f, "rb") as fin:
result = fin.read()
end = time.time()
print("%.1f im... | import glob
import time
import random
filelist = glob.glob('/mnt/lustre/chenyuntao1/datasets/imagenet/train/*/*')
random.shuffle(filelist)
begin = time.time()
for i, f in enumerate(filelist):
if i == 10000:
break
with open(f, "rb") as fin:
result = fin.read()
end = time.time()
print("%.1f im... | none | 1 | 2.478332 | 2 | |
ocellaris/solver_parts/boundary_conditions/dirichlet.py | TormodLandet/Ocellaris | 1 | 2352 | # Copyright (C) 2015-2019 <NAME>
# SPDX-License-Identifier: Apache-2.0
import dolfin
from . import register_boundary_condition, BoundaryConditionCreator
from ocellaris.utils import (
CodedExpression,
OcellarisCppExpression,
OcellarisError,
verify_field_variable_definition,
)
class OcellarisDirichletB... | # Copyright (C) 2015-2019 <NAME>
# SPDX-License-Identifier: Apache-2.0
import dolfin
from . import register_boundary_condition, BoundaryConditionCreator
from ocellaris.utils import (
CodedExpression,
OcellarisCppExpression,
OcellarisError,
verify_field_variable_definition,
)
class OcellarisDirichletB... | en | 0.859216 | # Copyright (C) 2015-2019 <NAME> # SPDX-License-Identifier: Apache-2.0 A simple storage class for Dirichlet boundary conditions The boundary value derivative function Returns the ds measure of the subdomain Return a copy with a new function space. Used when converting from BCs for a segregated solver (default) ... | 2.183008 | 2 |
count_split_inversions/test_count_split_inversions.py | abaldwin/algorithms | 0 | 2353 | import unittest
from count_split_inversions import count_inversions
class TestCountSplitInversions(unittest.TestCase):
def test_count_inversions(self):
input = [1, 3, 5, 2, 4, 6]
result = count_inversions(input)
self.assertEqual(result, 3)
if __name__ == '__main__':
unittest.main()
| import unittest
from count_split_inversions import count_inversions
class TestCountSplitInversions(unittest.TestCase):
def test_count_inversions(self):
input = [1, 3, 5, 2, 4, 6]
result = count_inversions(input)
self.assertEqual(result, 3)
if __name__ == '__main__':
unittest.main()
| none | 1 | 3.298789 | 3 | |
python/chronos/test/bigdl/chronos/forecaster/tf/test_seq2seq_keras_forecaster.py | Forest216/BigDL | 0 | 2354 | <filename>python/chronos/test/bigdl/chronos/forecaster/tf/test_seq2seq_keras_forecaster.py
#
# Copyright 2016 The BigDL 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:/... | <filename>python/chronos/test/bigdl/chronos/forecaster/tf/test_seq2seq_keras_forecaster.py
#
# Copyright 2016 The BigDL 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:/... | en | 0.853362 | # # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ... | 2.382927 | 2 |
examples/SubOrbitalFlight.py | nicolaikd/sl-ksp | 7 | 2355 | import time
import krpc
conn = krpc.connect(name='Sub-orbital flight')
vessel = conn.space_center.active_vessel
vessel.auto_pilot.target_pitch_and_heading(90, 90)
vessel.auto_pilot.engage()
vessel.control.throttle = 1
time.sleep(1)
print('Launch!')
vessel.control.activate_next_stage()
fuel_amount = conn.get_call(ve... | import time
import krpc
conn = krpc.connect(name='Sub-orbital flight')
vessel = conn.space_center.active_vessel
vessel.auto_pilot.target_pitch_and_heading(90, 90)
vessel.auto_pilot.engage()
vessel.control.throttle = 1
time.sleep(1)
print('Launch!')
vessel.control.activate_next_stage()
fuel_amount = conn.get_call(ve... | none | 1 | 2.489255 | 2 | |
part02/part02-e11_rows_and_columns/src/rows_and_columns.py | davide-butera/data-analysis-with-python | 0 | 2356 | <gh_stars>0
#!/usr/bin/env python3
import numpy as np
def get_rows(a):
return list(a)
def get_columns(a):
return list(a.T)
def main():
np.random.seed(0)
a=np.random.randint(0,10, (4,4))
print("a:", a)
print("Rows:", get_rows(a))
print("Columns:", get_columns(a))
if __name__ == "__main__"... | #!/usr/bin/env python3
import numpy as np
def get_rows(a):
return list(a)
def get_columns(a):
return list(a.T)
def main():
np.random.seed(0)
a=np.random.randint(0,10, (4,4))
print("a:", a)
print("Rows:", get_rows(a))
print("Columns:", get_columns(a))
if __name__ == "__main__":
main() | fr | 0.221828 | #!/usr/bin/env python3 | 3.200209 | 3 |
ramp-database/ramp_database/tools/leaderboard.py | kegl/ramp-board | 0 | 2357 | from distutils.version import LooseVersion
from itertools import product
import numpy as np
import pandas as pd
from ..model.event import Event
from ..model.event import EventTeam
from ..model.submission import Submission
from ..model.team import Team
from .team import get_event_team_by_name
from .submission import... | from distutils.version import LooseVersion
from itertools import product
import numpy as np
import pandas as pd
from ..model.event import Event
from ..model.event import EventTeam
from ..model.submission import Submission
from ..model.team import Team
from .team import get_event_team_by_name
from .submission import... | en | 0.686963 | Format the leaderboard. Parameters ---------- session : :class:`sqlalchemy.orm.Session` The session to directly perform the operation on the database. submissions : list of :class:`ramp_database.model.Submission` The submission to report in the leaderboard. leaderboard_type : {'publ... | 2.430212 | 2 |
projects/boring_stuff/03_functions/ZigZag.py | SavantLogics/Visual_Studio_Python_Scripts-master | 0 | 2358 | #Automate the Boring Stuff with Python
import time, sys
indent = 0 # How many spaces to indent
indent_Increasing = True # Whether the indentation is increasing or not
try:
while True: # The main program loop
print(' ' * indent, end='')
print('********')
time.sleep(0.1) # Pause for 1/10th o... | #Automate the Boring Stuff with Python
import time, sys
indent = 0 # How many spaces to indent
indent_Increasing = True # Whether the indentation is increasing or not
try:
while True: # The main program loop
print(' ' * indent, end='')
print('********')
time.sleep(0.1) # Pause for 1/10th o... | en | 0.857373 | #Automate the Boring Stuff with Python # How many spaces to indent # Whether the indentation is increasing or not # The main program loop # Pause for 1/10th of a second | 3.855824 | 4 |
examples/add_compensation_to_sample.py | whitews/ReFlowRESTClient | 0 | 2359 | import getpass
import sys
import json
from reflowrestclient.utils import *
host = raw_input('Host: ')
username = raw_input('Username: ')
password = <PASSWORD>('Password: ')
token = get_token(host, username, password)
if token:
print "Authentication successful"
print '=' * 40
else:
print "No token for you... | import getpass
import sys
import json
from reflowrestclient.utils import *
host = raw_input('Host: ')
username = raw_input('Username: ')
password = <PASSWORD>('Password: ')
token = get_token(host, username, password)
if token:
print "Authentication successful"
print '=' * 40
else:
print "No token for you... | en | 0.722525 | # Projects # Subjects # Sites # Samples # Compensation # Now have user verify information | 2.802631 | 3 |
accountifie/toolkit/urls.py | imcallister/accountifie | 4 | 2360 | from django.conf import settings
from django.conf.urls import url, static
from . import views
from . import jobs
urlpatterns = [
url(r'^choose_company/(?P<company_id>.*)/$', views.choose_company, name='choose_company'),
url(r'^cleanlogs/$', jobs.cleanlogs, name='cleanlogs'),
url(r'^primecache/$', job... | from django.conf import settings
from django.conf.urls import url, static
from . import views
from . import jobs
urlpatterns = [
url(r'^choose_company/(?P<company_id>.*)/$', views.choose_company, name='choose_company'),
url(r'^cleanlogs/$', jobs.cleanlogs, name='cleanlogs'),
url(r'^primecache/$', job... | none | 1 | 1.642088 | 2 | |
setup.py | sequentialchaos/i3-workspace-swap | 0 | 2361 | <gh_stars>0
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="i3-workspace-swap",
description='A python utility swap the content of two workplaces in i3wm',
long_description=long_description,
long_description_content_type="text/markdown",
... | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="i3-workspace-swap",
description='A python utility swap the content of two workplaces in i3wm',
long_description=long_description,
long_description_content_type="text/markdown",
version="1... | none | 1 | 1.694047 | 2 | |
ROS/fprime_ws/src/genfprime/src/genfprime/generate_modmk.py | genemerewether/fprime | 5 | 2362 | <gh_stars>1-10
#
# Copyright 2004-2016, by the California Institute of Technology.
# ALL RIGHTS RESERVED. United States Government Sponsorship
# acknowledged. Any commercial use must be negotiated with the Office
# of Technology Transfer at the California Institute of Technology.
#
# This software may be subj... | #
# Copyright 2004-2016, by the California Institute of Technology.
# ALL RIGHTS RESERVED. United States Government Sponsorship
# acknowledged. Any commercial use must be negotiated with the Office
# of Technology Transfer at the California Institute of Technology.
#
# This software may be subject to U.S. exp... | en | 0.777961 | # # Copyright 2004-2016, by the California Institute of Technology. # ALL RIGHTS RESERVED. United States Government Sponsorship # acknowledged. Any commercial use must be negotiated with the Office # of Technology Transfer at the California Institute of Technology. # # This software may be subject to U.S. exp... | 1.829019 | 2 |
tests/test_compare.py | fool65c/jupytext | 1 | 2363 | import pytest
from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell
from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion
def test_raise_on_different_metadata():
ref = new_notebook(metadata={'kernelspec': {'lan... | import pytest
from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell
from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion
def test_raise_on_different_metadata():
ref = new_notebook(metadata={'kernelspec': {'lan... | none | 1 | 2.139503 | 2 | |
Cogs/Actions.py | MrAngelDo6pa/MedBotS | 2 | 2364 | import asyncio
import discord
import random
import datetime
from discord.ext import commands
from Cogs import DisplayName
from Cogs import Nullify
def setup(bot):
# Add the bot
bot.add_cog(Actions(bot))
class Actions(commands.Cog):
## class that handles storing and computing action messages
class actionable... | import asyncio
import discord
import random
import datetime
from discord.ext import commands
from Cogs import DisplayName
from Cogs import Nullify
def setup(bot):
# Add the bot
bot.add_cog(Actions(bot))
class Actions(commands.Cog):
## class that handles storing and computing action messages
class actionable... | en | 0.849668 | # Add the bot ## class that handles storing and computing action messages ## these should be filled in the override class. any {} are replaced with target member's name # when you call without any arguments # when the action is done at the bot # when the action is done at the user who called it # when the action is don... | 2.986787 | 3 |
marltoolbox/examples/tune_function_api/lola_pg_official.py | tobiasbaumann1/amd | 0 | 2365 | <reponame>tobiasbaumann1/amd<filename>marltoolbox/examples/tune_function_api/lola_pg_official.py
##########
# Additional dependencies are needed:
# Follow the LOLA installation described in the tune_class_api/lola_pg_official.py file
##########
import os
import ray
from ray import tune
import marltoolbox.algos.lola.e... | ##########
# Additional dependencies are needed:
# Follow the LOLA installation described in the tune_class_api/lola_pg_official.py file
##########
import os
import ray
from ray import tune
import marltoolbox.algos.lola.envs as lola_envs
import marltoolbox.algos.lola_dice.envs as lola_dice_envs
from marltoolbox.algos... | en | 0.681836 | ########## # Additional dependencies are needed: # Follow the LOLA installation described in the tune_class_api/lola_pg_official.py file ########## # Instantiate the environment # Import the right training function # Sanity # Resolve default parameters # Dynamically set # "exp_name": "IPD", # "exp_name": "IMP", # "exp_... | 2.011394 | 2 |
src/cut_link/utils.py | true7/srt | 0 | 2366 | <gh_stars>0
import string
import random
import json
from calendar import month_name
from django.conf import settings
SHORTLINK_MIN = getattr(settings, "SHORTLINK_MIN", 6)
def code_generator(size=SHORTLINK_MIN):
chars = string.ascii_letters + string.digits
return ''.join(random.choice(chars) for _ in range(si... | import string
import random
import json
from calendar import month_name
from django.conf import settings
SHORTLINK_MIN = getattr(settings, "SHORTLINK_MIN", 6)
def code_generator(size=SHORTLINK_MIN):
chars = string.ascii_letters + string.digits
return ''.join(random.choice(chars) for _ in range(size))
def c... | en | 0.923468 | Return json format data, ready for passing into AmCharts. Contains 2 items - name of the month and count of distinct links, which were cut on the website. # FIXME. The problem is every next year it will add results above | 2.5913 | 3 |
lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py | blankenberg/galaxy-data-resource | 0 | 2367 | #!/usr/bin/python
import argparse
import ConfigParser
import os
import sys
new_path = [ os.path.join( os.getcwd(), "lib" ) ]
new_path.extend( sys.path[1:] )
sys.path = new_path
from galaxy import eggs
eggs.require( "SQLAlchemy >= 0.4" )
import galaxy.webapps.tool_shed.model.mapping as tool_shed_model
from sqlalchemy.... | #!/usr/bin/python
import argparse
import ConfigParser
import os
import sys
new_path = [ os.path.join( os.getcwd(), "lib" ) ]
new_path.extend( sys.path[1:] )
sys.path = new_path
from galaxy import eggs
eggs.require( "SQLAlchemy >= 0.4" )
import galaxy.webapps.tool_shed.model.mapping as tool_shed_model
from sqlalchemy.... | ru | 0.258958 | #!/usr/bin/python | 2.183129 | 2 |
moto/dynamodbstreams/responses.py | jonnangle/moto-1 | 3 | 2368 | <reponame>jonnangle/moto-1<gh_stars>1-10
from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import dynamodbstreams_backends
from six import string_types
class DynamoDBStreamsHandler(BaseResponse):
@property
def backend(self):
return dynamodbstreams_back... | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import dynamodbstreams_backends
from six import string_types
class DynamoDBStreamsHandler(BaseResponse):
@property
def backend(self):
return dynamodbstreams_backends[self.region]
def describe_strea... | en | 0.731834 | # according to documentation sequence_number param should be string | 2.161518 | 2 |
tools/mo/openvino/tools/mo/front/mxnet/zeros_ext.py | ytorzuk-altran/openvino | 1 | 2369 | <reponame>ytorzuk-altran/openvino
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs
from openvino.tools.mo.ops.const import... | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs
from openvino.tools.mo.ops.const import Const
class ZerosFrontExtractor... | en | 0.324138 | # Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # update the attributes of the node | 2.082448 | 2 |
tools/jslib_builder.py | Jumpscale/jumpscale_portal8 | 0 | 2370 |
from JumpScale import j
class builder():
# @property
# def buildDir(self):
# return j.sal.fs.joinPaths(j.dirs.tmpDir, "jsbuilder")
@property
def cuisine(self):
return j.tools.cuisine.local
# ALL NOT NEEDED ANY LONGER USE bower
# def angular(self):
# version = "1.5... |
from JumpScale import j
class builder():
# @property
# def buildDir(self):
# return j.sal.fs.joinPaths(j.dirs.tmpDir, "jsbuilder")
@property
def cuisine(self):
return j.tools.cuisine.local
# ALL NOT NEEDED ANY LONGER USE bower
# def angular(self):
# version = "1.5... | en | 0.291703 | # @property # def buildDir(self): # return j.sal.fs.joinPaths(j.dirs.tmpDir, "jsbuilder") # ALL NOT NEEDED ANY LONGER USE bower # def angular(self): # version = "1.5.9" # url = "http://code.angularjs.org/%s/angular-%s.zip" % (version, version) # path = j.do.download(url, to='', overwrite=False, retry=3,... | 2.13004 | 2 |
SimpleSimulator/samuelator.py | Anindya-Prithvi/CO_M21_Assignment | 3 | 2371 | <gh_stars>1-10
import sys
import warnings
import matplotlib.pyplot as plt
from parsets import IMACC, IMG, PROGC, REGFLPC, ExecE, plot
warnings.filterwarnings("ignore")
MEM = IMACC(sys.stdin.read()) # Load memory from stdin
PC = PROGC(0) # Start from the first instruction
RF = REGFLPC() # initialize register and f... | import sys
import warnings
import matplotlib.pyplot as plt
from parsets import IMACC, IMG, PROGC, REGFLPC, ExecE, plot
warnings.filterwarnings("ignore")
MEM = IMACC(sys.stdin.read()) # Load memory from stdin
PC = PROGC(0) # Start from the first instruction
RF = REGFLPC() # initialize register and flags
EE = ExecE... | en | 0.751747 | # Load memory from stdin # Start from the first instruction # initialize register and flags # Get current instruction # Update RF compute new_PC # Print PC # Print RF state # Update PC # Print memory state # plotting | 2.611256 | 3 |
utils/converters.py | LiReNa00/JDBot | 0 | 2372 | <filename>utils/converters.py<gh_stars>0
import discord
import re
import emoji
import contextlib
import typing
import datetime
from discord.ext import commands
from discord.http import Route
class BetterMemberConverter(commands.Converter):
async def convert(self, ctx, argument):
try:
user = aw... | <filename>utils/converters.py<gh_stars>0
import discord
import re
import emoji
import contextlib
import typing
import datetime
from discord.ext import commands
from discord.http import Route
class BetterMemberConverter(commands.Converter):
async def convert(self, ctx, argument):
try:
user = aw... | en | 0.683699 | Returns a numeric snowflake pretending to be created at the given date but more accurate and random than time_snowflake. If No dt is not passed, it makes one from the current time using utcnow. Parameters ----------- dt: :class:`datetime.datetime` A datetime object to convert to a snowflake. ... | 2.414644 | 2 |
kissim/cli/encode.py | AJK-dev/kissim | 15 | 2373 | """
kissim.cli.encode
Encode structures (generate fingerprints) from CLI arguments.
"""
import numpy as np
from kissim.api import encode
from kissim.cli.utils import configure_logger
def encode_from_cli(args):
"""
Encode structures.
Parameters
----------
args : argsparse.Namespace
CLI ... | """
kissim.cli.encode
Encode structures (generate fingerprints) from CLI arguments.
"""
import numpy as np
from kissim.api import encode
from kissim.cli.utils import configure_logger
def encode_from_cli(args):
"""
Encode structures.
Parameters
----------
args : argsparse.Namespace
CLI ... | en | 0.520831 | kissim.cli.encode Encode structures (generate fingerprints) from CLI arguments. Encode structures. Parameters ---------- args : argsparse.Namespace CLI arguments. Parse structure KLIFS IDs. Parameters ---------- args_input : list of str Either path to txt file with structure K... | 2.714598 | 3 |
distanceProfile.py | ZiyaoWei/pyMatrixProfile | 29 | 2374 | import numpy as np
from util import *
def naiveDistanceProfile(tsA, idx, m, tsB = None):
"""Return the distance profile of query against ts. Use the naive all pairs comparison algorithm.
>>> np.round(naiveDistanceProfile(np.array([0.0, 1.0, -1.0, 0.0]), 0, 4, np.array([-1, 1, 0, 0, -1, 1])), 3)
array([[ 2... | import numpy as np
from util import *
def naiveDistanceProfile(tsA, idx, m, tsB = None):
"""Return the distance profile of query against ts. Use the naive all pairs comparison algorithm.
>>> np.round(naiveDistanceProfile(np.array([0.0, 1.0, -1.0, 0.0]), 0, 4, np.array([-1, 1, 0, 0, -1, 1])), 3)
array([[ 2... | en | 0.400622 | Return the distance profile of query against ts. Use the naive all pairs comparison algorithm. >>> np.round(naiveDistanceProfile(np.array([0.0, 1.0, -1.0, 0.0]), 0, 4, np.array([-1, 1, 0, 0, -1, 1])), 3) array([[ 2. , 2.828, 2. ], [ 0. , 0. , 0. ]]) >>> np.round(stampDistanceProfile(np... | 2.65296 | 3 |
test_0000.py | theo-dim/cash-gels-thesis | 0 | 2375 | import pyplot as plt
import numpy as np
from sklearn import linear_model
| import pyplot as plt
import numpy as np
from sklearn import linear_model
| none | 1 | 1.202181 | 1 | |
vnTrader/uiMainWindow.py | bttt123/TradeSim | 0 | 2376 | # encoding: UTF-8
from builtins import str
import psutil
# import sys
# PyQt 4/5 compatibility
try:
from PyQt4.QtGui import QMainWindow, QDialog, QDockWidget, QAction, QHeaderView, QMessageBox, QLabel, QVBoxLayout
from PyQt4 import QtCore
except ImportError:
from PyQt5.QtWidgets import QMainWindow, QDial... | # encoding: UTF-8
from builtins import str
import psutil
# import sys
# PyQt 4/5 compatibility
try:
from PyQt4.QtGui import QMainWindow, QDialog, QDockWidget, QAction, QHeaderView, QMessageBox, QLabel, QVBoxLayout
from PyQt4 import QtCore
except ImportError:
from PyQt5.QtWidgets import QMainWindow, QDial... | zh | 0.108618 | # encoding: UTF-8 # import sys # PyQt 4/5 compatibility #from . import uiBasicWidget as wgs ######################################################################## 主窗口 # ---------------------------------------------------------------------- Constructor # 用来保存子窗口的字典 #self.setWindowTitle('VnTrader: ' + str(user) + "/" +... | 1.967135 | 2 |
line_notify_core.py | ficgra/PChome-alertor | 1 | 2377 | <gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import requests
import json
import re
from flask import Flask, request, abort
import mysql.connector as mariadb
from mysql.connector import Error
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatur... | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import requests
import json
import re
from flask import Flask, request, abort
import mysql.connector as mariadb
from mysql.connector import Error
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from l... | zh | 0.699539 | #!/usr/bin/env python # coding: utf-8 # In[ ]: #line 官方帳號 /callback測試Event # get X-Line-Signature header value # get request body as text # handle webhook body #line官方帳號收到訊息時的Event # get user id when reply #notify註冊時會post至/register #註冊事件 #拿code去要access_token #state = user_id 使用者id #帳號名稱 #取得access_token 發訊息給使用者的token #發... | 2.105179 | 2 |
sfc_models/examples/scripts/intro_X_XX_sim_multiplier.py | MachineLP/SFC_models | 21 | 2378 | <reponame>MachineLP/SFC_models<gh_stars>10-100
# coding=utf-8
from sfc_models.objects import *
from sfc_models.examples.Quick2DPlot import Quick2DPlot
register_standard_logs('output', __file__)
mod = Model()
country = Country(mod, 'CO')
Household(country, 'HH')
ConsolidatedGovernment(country, 'GOV')
FixedMarginBusine... | # coding=utf-8
from sfc_models.objects import *
from sfc_models.examples.Quick2DPlot import Quick2DPlot
register_standard_logs('output', __file__)
mod = Model()
country = Country(mod, 'CO')
Household(country, 'HH')
ConsolidatedGovernment(country, 'GOV')
FixedMarginBusiness(country, 'BUS', profit_margin=.025)
Market(c... | en | 0.929805 | # coding=utf-8 # At time period 25, cut spending to 17 (from 20) | 2.363838 | 2 |
auth_framework/settings.py | DrChai/django-auth-framework | 0 | 2379 | from importlib import import_module
from django.conf import settings
from django.core.signals import setting_changed
SOCIALACCOUNT_MODEL = getattr(settings, "REST_AUTH_SOCIALACCOUNT_MODEL", "auth_framework.SocialAccount")
DEFAULTS = {
'UNIQUE_EMAIL': True,
'RESET_PASSWORD_BY': 'pin', # 'url'| 'pin'
'SER... | from importlib import import_module
from django.conf import settings
from django.core.signals import setting_changed
SOCIALACCOUNT_MODEL = getattr(settings, "REST_AUTH_SOCIALACCOUNT_MODEL", "auth_framework.SocialAccount")
DEFAULTS = {
'UNIQUE_EMAIL': True,
'RESET_PASSWORD_BY': 'pin', # 'url'| 'pin'
'SER... | en | 0.54274 | # 'url'| 'pin' # 'SOCIAL_LOGIN_SERIALIZER': 'auth.social.serializers.DefaultSocialLoginSerializer', # SOCIAL LOGINS # eg: 'https://developers.google.com/oauthplayground' # SIGN UP # 'SIGNUP_EMAIL_VERIFICATION': 'none', # trimmed out email verification celery task in closed source. fewer usage # ADVANCES # Check if pres... | 1.902155 | 2 |
shorty/models.py | gkiserpong/shorty | 0 | 2380 | <filename>shorty/models.py
from django.db import models
from shorty.manager import UrlManager
class Url(models.Model):
long_url = models.URLField()
short_id = models.SlugField()
counter = models.IntegerField(default=0)
def __str__(self):
return "%s -- %s" % (self.long_url, self.short_id)
... | <filename>shorty/models.py
from django.db import models
from shorty.manager import UrlManager
class Url(models.Model):
long_url = models.URLField()
short_id = models.SlugField()
counter = models.IntegerField(default=0)
def __str__(self):
return "%s -- %s" % (self.long_url, self.short_id)
... | none | 1 | 2.377807 | 2 | |
test/sec_full.py | time-track-tool/time-track-tool | 0 | 2381 | security = """
New Web users get the Roles "User,Nosy"
New Email users get the Role "User"
Role "admin":
User may access the rest interface (Rest Access)
User may access the web interface (Web Access)
User may access the xmlrpc interface (Xmlrpc Access)
User may create everything (Create)
User may edit everything ... | security = """
New Web users get the Roles "User,Nosy"
New Email users get the Role "User"
Role "admin":
User may access the rest interface (Rest Access)
User may access the web interface (Web Access)
User may access the xmlrpc interface (Xmlrpc Access)
User may create everything (Create)
User may edit everything ... | en | 0.861113 | New Web users get the Roles "User,Nosy" New Email users get the Role "User" Role "admin": User may access the rest interface (Rest Access) User may access the web interface (Web Access) User may access the xmlrpc interface (Xmlrpc Access) User may create everything (Create) User may edit everything (Edit) User ma... | 1.782061 | 2 |
CodeChef/problems/IMDB/main.py | object-oriented-human/competitive | 1 | 2382 | <filename>CodeChef/problems/IMDB/main.py
tc = int(input())
while tc:
tc -= 1
best = 0
n, x = map(int, input().split())
for i in range(n):
s, r = map(int, input().split())
if x >= s:
best = max(best, r)
print(best) | <filename>CodeChef/problems/IMDB/main.py
tc = int(input())
while tc:
tc -= 1
best = 0
n, x = map(int, input().split())
for i in range(n):
s, r = map(int, input().split())
if x >= s:
best = max(best, r)
print(best) | none | 1 | 3.3387 | 3 | |
tests/test_sqlite_wrapper.py | Privex/python-db | 1 | 2383 | <gh_stars>1-10
"""
Tests related to :class:`.SqliteWrapper` / :class:`.ExampleWrapper`
"""
# from unittest import TestCase
from tests.base import *
class TestSQLiteWrapper(PrivexDBTestBase):
def test_tables_created(self):
w = self.wrp
self.assertEqual(w.db, ':memory:')
tables = w.list... | """
Tests related to :class:`.SqliteWrapper` / :class:`.ExampleWrapper`
"""
# from unittest import TestCase
from tests.base import *
class TestSQLiteWrapper(PrivexDBTestBase):
def test_tables_created(self):
w = self.wrp
self.assertEqual(w.db, ':memory:')
tables = w.list_tables()
... | en | 0.268084 | Tests related to :class:`.SqliteWrapper` / :class:`.ExampleWrapper` # from unittest import TestCase | 2.562604 | 3 |
var/spack/repos/builtin/packages/strumpack/package.py | robertodr/spack | 9 | 2384 | <gh_stars>1-10
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Strumpack(CMakePackage, CudaPackage):
"""STRUMPACK -- STRUctured Matrix PAC... | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Strumpack(CMakePackage, CudaPackage):
"""STRUMPACK -- STRUctured Matrix PACKage - provides... | en | 0.843061 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) STRUMPACK -- STRUctured Matrix PACKage - provides linear solvers for sparse matrices and for dense rank-structured matr... | 1.745156 | 2 |
actionserver/actions/action_feedbackform.py | Ajju2211/frendy-bot | 0 | 2385 | from typing import Any, Text, Dict, List, Union
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction
from rasa_sdk.events import UserUtteranceReverted, UserUttered, FollowupAction
# from rasa_core.events import (UserUtteranceReverted, UserUttered... | from typing import Any, Text, Dict, List, Union
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction
from rasa_sdk.events import UserUtteranceReverted, UserUttered, FollowupAction
# from rasa_core.events import (UserUtteranceReverted, UserUttered... | en | 0.468271 | # from rasa_core.events import (UserUtteranceReverted, UserUttered, # ActionExecuted, Event) # takes quantity from user # Code snippet for global back # return [Restarted(), UserUttered(text="/get_started", parse_data={ # "intent": {"confidence": 1.0, "name": "get_started"}, # "entitie... | 2.122812 | 2 |
dash/graphs.py | fuzzylabs/wearable-my-foot | 5 | 2386 | import plotly.graph_objs as go
class GraphsHelper:
template = "plotly_dark"
'''
Generate a plot for a timeseries
'''
def generate_timeseries_plot(self, dataframe):
pressure_plots = []
for sensor in ["p1", "p2", "p3"]:
series = dataframe[sensor]
scatter = go.... | import plotly.graph_objs as go
class GraphsHelper:
template = "plotly_dark"
'''
Generate a plot for a timeseries
'''
def generate_timeseries_plot(self, dataframe):
pressure_plots = []
for sensor in ["p1", "p2", "p3"]:
series = dataframe[sensor]
scatter = go.... | en | 0.784071 | Generate a plot for a timeseries | 3.137202 | 3 |
azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_resource.py | JonathanGailliez/azure-sdk-for-python | 1 | 2387 | <reponame>JonathanGailliez/azure-sdk-for-python
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by M... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | en | 0.527075 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ... | 2.029361 | 2 |
telethon/tl/functions/stickers.py | polisitni1/DogeClickBot | 0 | 2388 | """File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLRequest
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
if TYPE_CHECKING:
from ...tl.types import TypeInputStickerSet, TypeInputUser, TypeInputStickerSetItem, TypeInputDocument
cl... | """File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLRequest
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
if TYPE_CHECKING:
from ...tl.types import TypeInputStickerSet, TypeInputUser, TypeInputStickerSetItem, TypeInputDocument
cl... | en | 0.279818 | File generated by TLObjects' generator. All changes will be ERASED :param TypeInputStickerSet stickerset: :param TypeInputStickerSetItem sticker: :returns messages.StickerSet: Instance of StickerSet. # type: TypeInputStickerSet # type: TypeInputStickerSetItem :param TypeInputDocument sticker: :... | 2.300266 | 2 |
applications/ChimeraApplication/tests/chimera_analysis_base_test.py | lkusch/Kratos | 778 | 2389 | <gh_stars>100-1000
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as UnitTest
import KratosMultiphysics.ChimeraApplication
from KratosMultiphysics.ChimeraApplication.fluid_chimera_analysis import FluidChimeraAnalysis
class ChimeraAnalysisBaseTest(UnitTest.TestCase):
def setUp(self):
# ... | import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as UnitTest
import KratosMultiphysics.ChimeraApplication
from KratosMultiphysics.ChimeraApplication.fluid_chimera_analysis import FluidChimeraAnalysis
class ChimeraAnalysisBaseTest(UnitTest.TestCase):
def setUp(self):
# Set to true to get ... | en | 0.252107 | # Set to true to get post-process files for the test # to check the results: add output settings block if needed { "vtk_output" : [{ "python_module" : "vtk_output_process", "kratos_module" : "KratosMultiphysics", "process_name" : "VtkOutputPro... | 2.18305 | 2 |
parsers/rss10.py | side-beach-city/SBCLinkCopyTool | 0 | 2390 | <filename>parsers/rss10.py
import urllib.request
import xml.etree.ElementTree
class RSS10Parser:
def __init__(self, url: str) -> None:
self.url = url
def getlist(self) -> list[dict[str, str]]:
ENTRY = r"{http://www.w3.org/2005/Atom}"
MEDIA = r"{http://search.yahoo.com/mrss/}"
YOUTUBE = r"{http://w... | <filename>parsers/rss10.py
import urllib.request
import xml.etree.ElementTree
class RSS10Parser:
def __init__(self, url: str) -> None:
self.url = url
def getlist(self) -> list[dict[str, str]]:
ENTRY = r"{http://www.w3.org/2005/Atom}"
MEDIA = r"{http://search.yahoo.com/mrss/}"
YOUTUBE = r"{http://w... | none | 1 | 3.091866 | 3 | |
examples/laser.py | MPI-IS/reactive_pepper | 0 | 2391 | <gh_stars>0
import math,time,random
import pepper_interface
IP = "192.168.0.147"
PORT = 9559
simulation = False
with pepper_interface.get(IP,PORT,simulation) as pepper:
time.sleep(1.0)
values,time_stamp = pepper.laser.get()
print
print "Front"
print values["Front"]
print
print "Left"
... | import math,time,random
import pepper_interface
IP = "192.168.0.147"
PORT = 9559
simulation = False
with pepper_interface.get(IP,PORT,simulation) as pepper:
time.sleep(1.0)
values,time_stamp = pepper.laser.get()
print
print "Front"
print values["Front"]
print
print "Left"
print va... | none | 1 | 2.41701 | 2 | |
exercises/pt/exc_01_03_01.py | Jette16/spacy-course | 2,085 | 2392 | # Importar a classe da língua inglesa (English) e criar um objeto nlp
from ____ import ____
nlp = ____
# Processar o texto
doc = ____("I like tree kangaroos and narwhals.")
# Selecionar o primeiro token
first_token = doc[____]
# Imprimir o texto do primeito token
print(first_token.____)
| # Importar a classe da língua inglesa (English) e criar um objeto nlp
from ____ import ____
nlp = ____
# Processar o texto
doc = ____("I like tree kangaroos and narwhals.")
# Selecionar o primeiro token
first_token = doc[____]
# Imprimir o texto do primeito token
print(first_token.____)
| pt | 0.913677 | # Importar a classe da língua inglesa (English) e criar um objeto nlp # Processar o texto # Selecionar o primeiro token # Imprimir o texto do primeito token | 3.281285 | 3 |
tests/integration/mci/test_happy_path.py | qateam123/eq | 0 | 2393 | from tests.integration.create_token import create_token
from tests.integration.integration_test_case import IntegrationTestCase
class TestHappyPath(IntegrationTestCase):
def test_happy_path_203(self):
self.happy_path('0203', '1')
def test_happy_path_205(self):
self.happy_path('0205', '1')
... | from tests.integration.create_token import create_token
from tests.integration.integration_test_case import IntegrationTestCase
class TestHappyPath(IntegrationTestCase):
def test_happy_path_203(self):
self.happy_path('0203', '1')
def test_happy_path_205(self):
self.happy_path('0205', '1')
... | en | 0.871966 | # Get a token # We are on the landing page # We proceed to the questionnaire # We are in the Questionnaire # check with have some guidance # We fill in our answers # Start Date # End Date # Total Turnover # User Action # We submit the form # There are no validation errors # We are on the review answers page # We submit... | 2.418591 | 2 |
src/transformers/models/hubert/modeling_tf_hubert.py | OllieBroadhurst/transformers | 1 | 2394 | <gh_stars>1-10
# coding=utf-8
# Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. 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.apach... | # coding=utf-8
# Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. 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/... | en | 0.680233 | # coding=utf-8 # Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. 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/... | 1.701516 | 2 |
600/unit-1/recursion/problem-set/mit-solutions/ps2_hangman_sol1.py | marioluan/mit-opencourseware-cs | 0 | 2395 | # 6.00 Problem Set 2
#
# Hangman
# Name : Solutions
# Collaborators : <your collaborators>
# Time spent : <total time>
# -----------------------------------
# Helper code
# You don't need to understand this helper code,
# but you will have to know how to use the functions
import random
import string
WO... | # 6.00 Problem Set 2
#
# Hangman
# Name : Solutions
# Collaborators : <your collaborators>
# Time spent : <total time>
# -----------------------------------
# Helper code
# You don't need to understand this helper code,
# but you will have to know how to use the functions
import random
import string
WO... | en | 0.843606 | # 6.00 Problem Set 2 # # Hangman # Name : Solutions # Collaborators : <your collaborators> # Time spent : <total time> # ----------------------------------- # Helper code # You don't need to understand this helper code, # but you will have to know how to use the functions Returns a list of valid words. Word... | 4.104069 | 4 |
top/api/rest/FenxiaoRefundMessageAddRequest.py | forestsheep/middleman | 0 | 2396 | <reponame>forestsheep/middleman
'''
Created by auto_sdk on 2016.04.13
'''
from top.api.base import RestApi
class FenxiaoRefundMessageAddRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.image = None
self.message_content = None
self.sub_order_id = ... | '''
Created by auto_sdk on 2016.04.13
'''
from top.api.base import RestApi
class FenxiaoRefundMessageAddRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.image = None
self.message_content = None
self.sub_order_id = None
def getapiname(self):
r... | en | 0.760391 | Created by auto_sdk on 2016.04.13 | 1.787269 | 2 |
image-generation/slegan/args.py | AaratiAkkapeddi/nnabla-examples | 228 | 2397 | <filename>image-generation/slegan/args.py
# Copyright 2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | <filename>image-generation/slegan/args.py
# Copyright 2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | en | 0.805324 | # Copyright 2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi... | 2.37581 | 2 |
day1/files_ex1.py | grenn72/pynet-ons-feb19 | 0 | 2398 | <gh_stars>0
#!/usr/bin/env python
from __future__ import print_function
# READ ####
f = open("my_file.txt")
print("\nLoop directly over file")
print("-" * 60)
for line in f:
print(line.strip())
print("-" * 60)
f.seek(0)
my_content = f.readlines()
print("\nUse readlines method")
print("-" * 60)
for line in my_cont... | #!/usr/bin/env python
from __future__ import print_function
# READ ####
f = open("my_file.txt")
print("\nLoop directly over file")
print("-" * 60)
for line in f:
print(line.strip())
print("-" * 60)
f.seek(0)
my_content = f.readlines()
print("\nUse readlines method")
print("-" * 60)
for line in my_content:
pri... | de | 0.364347 | #!/usr/bin/env python # READ #### # WRITE #### # APPEND #### | 3.734156 | 4 |
test/integration_tests/test_integration_datasets_client.py | self-host/selfhost-python-client | 0 | 2399 | import uuid
from typing import List, Dict, Any
import unittest
from selfhost_client import SelfHostClient, DatasetType
class TestIntegrationDatasetsClient(unittest.TestCase):
"""
Run these tests individually because Self-Host will return HTTP 429 Too Many Requests otherwise.
"""
@classmethod
de... | import uuid
from typing import List, Dict, Any
import unittest
from selfhost_client import SelfHostClient, DatasetType
class TestIntegrationDatasetsClient(unittest.TestCase):
"""
Run these tests individually because Self-Host will return HTTP 429 Too Many Requests otherwise.
"""
@classmethod
de... | en | 0.923321 | Run these tests individually because Self-Host will return HTTP 429 Too Many Requests otherwise. # Create and delete happens in setup and teardown methods. | 2.71307 | 3 |