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 |
|---|---|---|---|---|---|---|---|---|---|---|
python/streambar/__init__.py | mvdwerve/streambar | 3 | 6629551 | from _streambar import * | from _streambar import * | none | 1 | 1.106714 | 1 | |
perses/tests/test_relative_point_mutation_setup.py | schallerdavid/perses | 99 | 6629552 | <filename>perses/tests/test_relative_point_mutation_setup.py
def test_PointMutationExecutor():
from pkg_resources import resource_filename
from simtk import unit
from perses.app.relative_point_mutation_setup import PointMutationExecutor
pdb_filename = resource_filename("perses", "data/ala_vacuum.pdb")... | <filename>perses/tests/test_relative_point_mutation_setup.py
def test_PointMutationExecutor():
from pkg_resources import resource_filename
from simtk import unit
from perses.app.relative_point_mutation_setup import PointMutationExecutor
pdb_filename = resource_filename("perses", "data/ala_vacuum.pdb")... | none | 1 | 2.062923 | 2 | |
LeetCode/1299.replace-elements-with-greatest-element-on-right-side.py | tushar-1728/Coding | 0 | 6629553 | <gh_stars>0
#
# @lc app=leetcode id=1299 lang=python3
#
# [1299] Replace Elements with Greatest Element on Right Side
#
# @lc code=start
from typing import List
class Solution:
def replaceElements(self, arr: List[int]) -> List[int]:
n = len(arr)
if n >= 1:
mval = arr[-1]
arr... | #
# @lc app=leetcode id=1299 lang=python3
#
# [1299] Replace Elements with Greatest Element on Right Side
#
# @lc code=start
from typing import List
class Solution:
def replaceElements(self, arr: List[int]) -> List[int]:
n = len(arr)
if n >= 1:
mval = arr[-1]
arr[-1] = -1
... | en | 0.439674 | # # @lc app=leetcode id=1299 lang=python3 # # [1299] Replace Elements with Greatest Element on Right Side # # @lc code=start # @lc code=end | 3.515955 | 4 |
elastalert/alerter/jira_alerter.py | JasperJuergensen/elastalert | 2 | 6629554 | import datetime
import logging
import sys
from elastalert.alerter import Alerter
from elastalert.alerter.match_string import JiraFormattedMatchString
from elastalert.exceptions import EAException
from elastalert.utils.time import pretty_ts, ts_now, ts_to_dt
from elastalert.utils.util import lookup_es_key
from jira.cli... | import datetime
import logging
import sys
from elastalert.alerter import Alerter
from elastalert.alerter.match_string import JiraFormattedMatchString
from elastalert.exceptions import EAException
from elastalert.utils.time import pretty_ts, ts_now, ts_to_dt
from elastalert.utils.util import lookup_es_key
from jira.cli... | en | 0.889007 | Creates a Jira ticket for each alert # Maintain a static set of built-in fields that we explicitly know how to set # For anything else, we will do best-effort and try to set a string value # Some built-in jira types that can be used as custom fields require special handling # Here is a sample of one of them: # {"id":"c... | 2.178936 | 2 |
examples/Assertions/Basic/test_plan_dict.py | raoyitao/testplan | 96 | 6629555 | #!/usr/bin/env python
# This plan contains tests that demonstrate failures as well.
"""
This example shows usage of dict assertion namespaces.
"""
import re
import sys
from testplan import test_plan
from testplan.common.utils import comparison
from testplan.testing.multitest import MultiTest, testsuite, testcase
from t... | #!/usr/bin/env python
# This plan contains tests that demonstrate failures as well.
"""
This example shows usage of dict assertion namespaces.
"""
import re
import sys
from testplan import test_plan
from testplan.common.utils import comparison
from testplan.testing.multitest import MultiTest, testsuite, testcase
from t... | en | 0.777793 | #!/usr/bin/env python # This plan contains tests that demonstrate failures as well. This example shows usage of dict assertion namespaces. `result.dict` namespace can be used for applying advanced assertion rules to dictionaries, which can be nested. # `dict.match` (recursively) matches elements of the dictionaries... | 3.28987 | 3 |
seekpath/hpkot/tools.py | qiaojunfeng/seekpath | 0 | 6629556 | <reponame>qiaojunfeng/seekpath<filename>seekpath/hpkot/tools.py
import numpy
import numpy.linalg
def eval_expr_simple(expr, kparam):
"""
To evaluate expressions tha only require kparams and not a, b, c, ...
"""
if expr == "0":
return 0.
elif expr == "1/2":
return 1. / 2.
elif e... | import numpy
import numpy.linalg
def eval_expr_simple(expr, kparam):
"""
To evaluate expressions tha only require kparams and not a, b, c, ...
"""
if expr == "0":
return 0.
elif expr == "1/2":
return 1. / 2.
elif expr == "1":
return 1.
elif expr == "-1/2":
r... | en | 0.791329 | To evaluate expressions tha only require kparams and not a, b, c, ... Extend the list of kparam with also expressions like :math:`1-x`, ... :param kparam: a dictionary where the key is the expression as a string and the value is the numerical value :return: a similar dictionary, extended with simple exp... | 3.476637 | 3 |
data/external/repositories_2to3/109477/gatsby-hackathon-seizure-master/code/python/seizures/helper/data_structures.py | Keesiu/meta-kaggle | 0 | 6629557 | <filename>data/external/repositories_2to3/109477/gatsby-hackathon-seizure-master/code/python/seizures/helper/data_structures.py
import numpy as np
def stack_matrices(X_list):
X_stack = np.vstack(X_list)
return X_stack
def stack_vectors(y_list):
tmp = np.concatenate(y_list)
return tmp
def ... | <filename>data/external/repositories_2to3/109477/gatsby-hackathon-seizure-master/code/python/seizures/helper/data_structures.py
import numpy as np
def stack_matrices(X_list):
X_stack = np.vstack(X_list)
return X_stack
def stack_vectors(y_list):
tmp = np.concatenate(y_list)
return tmp
def ... | en | 0.383045 | # old buggy version #def stack_matrices(X_list): # num_samples = np.sum([len(X) for X in X_list]) # dim = X_list[0].shape[1] # # X_stack = np.zeros((num_samples, dim)) # i = 0 # for i in range(len(X_list)): # X = X_list[i] # X_stack[i:(i + len(X))] = X # i += len(X) # return X_sta... | 2.598195 | 3 |
Agents/API/alarm.py | mbay-SAG/cumulocity-thinedge-example | 2 | 6629558 | import requests
import logging
import json
import API.authentication as auth
from datetime import datetime, date, time, timedelta
logger = logging.getLogger('Alarm API')
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger.info('Logger for Alarm was initialise... | import requests
import logging
import json
import API.authentication as auth
from datetime import datetime, date, time, timedelta
logger = logging.getLogger('Alarm API')
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger.info('Logger for Alarm was initialise... | none | 1 | 2.617378 | 3 | |
zdevelop/tests/test_client.py | illuscio-dev/spanclient-py | 0 | 6629559 | <reponame>illuscio-dev/spanclient-py
import pytest
import rapidjson as json
import uuid
import aiohttp
import yaml
import io
import csv
import copy
from aiostream.stream import enumerate as aio_enumeerate
from dataclasses import dataclass
from grahamcracker import DataSchema, schema_for
from bson import BSON
from bson.... | import pytest
import rapidjson as json
import uuid
import aiohttp
import yaml
import io
import csv
import copy
from aiostream.stream import enumerate as aio_enumeerate
from dataclasses import dataclass
from grahamcracker import DataSchema, schema_for
from bson import BSON
from bson.raw_bson import RawBSONDocument
from ... | en | 0.373491 | # Validator 1 # Validator 2 # Response 1 # Response 2 # Validator 1 # Response 1 # Validator 1 # Validator 2 # Response 1 # Response 2 # Validator 1 # Validator 2 # Response 1 # Response 2 # Validator 1 # Validator 2 # Validator 3 # Response 1 # Response 2 # Response 3 # Validator 1 # Validator 2 # Response 1 # Respons... | 2.000476 | 2 |
packages/news_classifier/news_classifier/models/pipeline.py | marco-cardoso/ML-News-article-classification-architecture | 0 | 6629560 | from sklearn.compose import ColumnTransformer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from news_classifier.config import variables
from news_classifier.features import DropFeatures
category_classifier = Pipeline(
steps=[
... | from sklearn.compose import ColumnTransformer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from news_classifier.config import variables
from news_classifier.features import DropFeatures
category_classifier = Pipeline(
steps=[
... | none | 1 | 2.412891 | 2 | |
xnote/app/views_calendar.py | sebastianczech/Xnote | 0 | 6629561 | <reponame>sebastianczech/Xnote<gh_stars>0
from datetime import datetime, timedelta
from django.shortcuts import render
from django.utils import dateparse
from googleapiclient.discovery import build
from . import api_google
def calendar(request):
# Get credential for Google API
credential = api_google.api_goo... | from datetime import datetime, timedelta
from django.shortcuts import render
from django.utils import dateparse
from googleapiclient.discovery import build
from . import api_google
def calendar(request):
# Get credential for Google API
credential = api_google.api_google_credential()
# Build a service ob... | en | 0.768695 | # Get credential for Google API # Build a service object for the API that you want to call # Make requests to the API service using the interface provided by the service object. # Get collection of calendars in the user's calendar list # Use calendarList, which method list() returns entries on the user's calendar list ... | 2.876917 | 3 |
code/ch07/perceptron_pos.py | imjaden/Introduction-NLP | 1,628 | 6629562 |
from pyhanlp import *
import zipfile
import os
from pyhanlp.static import download, remove_file, HANLP_DATA_PATH
def test_data_path():
"""
获取测试数据路径,位于$root/data/test,根目录由配置文件指定。
:return:
"""
data_path = os.path.join(HANLP_DATA_PATH, 'test')
if not os.path.isdir(data_path):
os.mkdir(d... |
from pyhanlp import *
import zipfile
import os
from pyhanlp.static import download, remove_file, HANLP_DATA_PATH
def test_data_path():
"""
获取测试数据路径,位于$root/data/test,根目录由配置文件指定。
:return:
"""
data_path = os.path.join(HANLP_DATA_PATH, 'test')
if not os.path.isdir(data_path):
os.mkdir(d... | zh | 0.959983 | 获取测试数据路径,位于$root/data/test,根目录由配置文件指定。 :return: ## 验证是否存在 MSR语料库,如果没有自动下载 ## 指定 PKU 语料库 ## =============================================== ## 以下开始 感知机 词性标注 # 训练感知机模型 # 加载 # 构造词法分析器,与感知机分词器结合,能同时进行分词和词性标注。 # 分词+词性标注 # 对词性进行翻译 | 2.651678 | 3 |
regression/linear_regression.py | nickblum/regression | 0 | 6629563 | <reponame>nickblum/regression
def compute_cost(X,y,theta):
pass
def gradient_descent(X,y,theta,regularize):
pass
def find_curve(X=0,y=0,alpha=100):
"""
NOTE TO SELF: USE numpy -- it's written in C and a zillion times faster than python functions for arrays and such
Need to include... | def compute_cost(X,y,theta):
pass
def gradient_descent(X,y,theta,regularize):
pass
def find_curve(X=0,y=0,alpha=100):
"""
NOTE TO SELF: USE numpy -- it's written in C and a zillion times faster than python functions for arrays and such
Need to include docstring here. A brief expla... | en | 0.849997 | NOTE TO SELF: USE numpy -- it's written in C and a zillion times faster than python functions for arrays and such Need to include docstring here. A brief explanation of the function X: A brief explanation of this variable y: A brief explanation of this variable alpha: This one ... | 3.212288 | 3 |
setup.py | GreenelyAB/TranslationsClient | 0 | 6629564 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = f.read()
setup(
name=... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = f.read()
setup(
name=... | en | 0.719398 | # -*- coding: utf-8 -*- # Get the long description from the README file | 1.441476 | 1 |
RIKEN/benchmarks/cosmoflow/implementations/implementation_fugaku_closed/mesh/mesh_tensorflow/layers.py | bgerofi/hpc_results_v0.7 | 2 | 6629565 | # coding=utf-8
# Copyright 2020 The Mesh TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | # coding=utf-8
# Copyright 2020 The Mesh TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | en | 0.76343 | # coding=utf-8 # Copyright 2020 The Mesh TensorFlow Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab... | 2.351554 | 2 |
tests/features/stubbing.py | flexmock/flexmock | 15 | 6629566 | <reponame>flexmock/flexmock
"""Tests for flexmock stubbing feature."""
# pylint: disable=missing-docstring,no-self-use,no-member
from flexmock import flexmock
from flexmock._api import flexmock_teardown
from tests import some_module
class StubbingTestCase:
def test_use_replace_with_for_callable_shortcut_kwargs(se... | """Tests for flexmock stubbing feature."""
# pylint: disable=missing-docstring,no-self-use,no-member
from flexmock import flexmock
from flexmock._api import flexmock_teardown
from tests import some_module
class StubbingTestCase:
def test_use_replace_with_for_callable_shortcut_kwargs(self):
class Foo:
... | en | 0.876259 | Tests for flexmock stubbing feature. # pylint: disable=missing-docstring,no-self-use,no-member | 2.427031 | 2 |
src/qrcode/pyqart/art/qart.py | lapinozz/ArtCoder | 15 | 6629567 | <reponame>lapinozz/ArtCoder<filename>src/qrcode/pyqart/art/qart.py
# Added at : 2016.8.2
# Author : 7sDream
# Usage : Accept data and source image, make a QArt.
import itertools
from random import randint
from .source import QArtSourceImage
from .bitblock import BitBlock
from ..qr import QrData, QrPainter
from .... | # Added at : 2016.8.2
# Author : 7sDream
# Usage : Accept data and source image, make a QArt.
import itertools
from random import randint
from .source import QArtSourceImage
from .bitblock import BitBlock
from ..qr import QrData, QrPainter
from ..qr.data.numbers import Numbers
from ..qr.painter.point import QrPo... | en | 0.351437 | # Added at : 2016.8.2 # Author : 7sDream # Usage : Accept data and source image, make a QArt. #assert isinstance(contentValues, (str, QArtSourceImage, Image.Image)) #if not isinstance(img, QArtSourceImage): #self.source = img #data = QrData(url + '#', level) #self._data.put_numbers('0' * numbers_count) upper = 0 ... | 2.555007 | 3 |
day05/1-xpath.py | Mhh123/spider | 0 | 6629568 | from lxml import etree
# 生成tree对象
tree = etree.parse('xpath.html')
print(tree)
#<lxml.etree._ElementTree object at 0x000000000252B388>
ret = tree.xpath('//div[@class="hero"]/text()')
"""
扩展:
def xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables): # real signature ... | from lxml import etree
# 生成tree对象
tree = etree.parse('xpath.html')
print(tree)
#<lxml.etree._ElementTree object at 0x000000000252B388>
ret = tree.xpath('//div[@class="hero"]/text()')
"""
扩展:
def xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables): # real signature ... | en | 0.551892 | # 生成tree对象 #<lxml.etree._ElementTree object at 0x000000000252B388> 扩展:
def xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables): # real signature unknown; restored from __doc__
xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_varia... | 3.41762 | 3 |
backtracking/minimax.py | jenia90/Python | 21 | 6629569 | <gh_stars>10-100
from __future__ import annotations
import math
""" Minimax helps to achieve maximum score in a game by checking all possible moves
depth is current depth in game tree.
nodeIndex is index of current node in scores[].
if move is of maximizer return true else false
leaves of game tree is... | from __future__ import annotations
import math
""" Minimax helps to achieve maximum score in a game by checking all possible moves
depth is current depth in game tree.
nodeIndex is index of current node in scores[].
if move is of maximizer return true else false
leaves of game tree is stored in scores... | en | 0.682908 | Minimax helps to achieve maximum score in a game by checking all possible moves depth is current depth in game tree. nodeIndex is index of current node in scores[]. if move is of maximizer return true else false leaves of game tree is stored in scores[] height is maximum height of Game tree >>> impo... | 4.173225 | 4 |
tests/test_games/test_go_fish/test_game.py | joedaws/motherbrain | 0 | 6629570 | <gh_stars>0
import pytest
from motherbrain.games.go_fish import INITIAL_HAND_SIZE_MAP
from motherbrain.games.run import create_game
from motherbrain import MOTHERBRAIN_PATH
import yaml
from yaml import Loader
import os
@pytest.fixture
def game():
"""Parse configs, create game, and play."""
config_path = os.pa... | import pytest
from motherbrain.games.go_fish import INITIAL_HAND_SIZE_MAP
from motherbrain.games.run import create_game
from motherbrain import MOTHERBRAIN_PATH
import yaml
from yaml import Loader
import os
@pytest.fixture
def game():
"""Parse configs, create game, and play."""
config_path = os.path.join(MOTH... | en | 0.869422 | Parse configs, create game, and play. # load config # load game # check player hands # check observations # check that deck has correct amount of cards | 2.246996 | 2 |
Lib/tkinter/test/test_tkinter/test_simpledialog.py | Kshitijkrishnadas/haribol | 2,441 | 6629571 | import unittest
import tkinter
from test.support import requires, run_unittest, swap_attr
from tkinter.test.support import AbstractDefaultRootTest
from tkinter.simpledialog import Dialog, askinteger
requires('gui')
class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
def test_askinteger(self):
... | import unittest
import tkinter
from test.support import requires, run_unittest, swap_attr
from tkinter.test.support import AbstractDefaultRootTest
from tkinter.simpledialog import Dialog, askinteger
requires('gui')
class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
def test_askinteger(self):
... | none | 1 | 2.556062 | 3 | |
mmcv/fileio/io.py | imabackstabber/mmcv | 0 | 6629572 | # Copyright (c) OpenMMLab. All rights reserved.
from io import BytesIO, StringIO
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, TextIO, Union
from ..utils import is_list_of
from .file_client import FileClient
from .handlers import BaseFileHandler, JsonHandler, PickleHandler, YamlHandl... | # Copyright (c) OpenMMLab. All rights reserved.
from io import BytesIO, StringIO
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, TextIO, Union
from ..utils import is_list_of
from .file_client import FileClient
from .handlers import BaseFileHandler, JsonHandler, PickleHandler, YamlHandl... | en | 0.73342 | # Copyright (c) OpenMMLab. All rights reserved. Load data from json/yaml/pickle files. This method provides a unified api for loading data from serialized files. Note: In v1.3.16 and later, ``load`` supports loading data from serialized files those can be storaged in different backends. A... | 2.575313 | 3 |
blodiator/graf/grfnodecore.py | MansourM61/Blodiator | 0 | 6629573 | <filename>blodiator/graf/grfnodecore.py<gh_stars>0
'''
********************************************************************************
Python Script: grfnodecore Module
Writter: <NAME>
Date: 7 Feburary 2019
This Python script is compatible with Python 3.x.
The script is used to define GrfNodeCore class the n... | <filename>blodiator/graf/grfnodecore.py<gh_stars>0
'''
********************************************************************************
Python Script: grfnodecore Module
Writter: <NAME>
Date: 7 Feburary 2019
This Python script is compatible with Python 3.x.
The script is used to define GrfNodeCore class the n... | en | 0.537055 | ********************************************************************************
Python Script: grfnodecore Module
Writter: <NAME>
Date: 7 Feburary 2019
This Python script is compatible with Python 3.x.
The script is used to define GrfNodeCore class the node in
Blodiator. The node used in the block diagrams i... | 2.091034 | 2 |
爬虫/第一章/获取页面.py | Aloof-0/codesr | 1 | 6629574 | # -*- coding: utf-8 -*-
# @Time : 2020/7/19 13:02
# @Author : Frosty
# @Email : <EMAIL>
# @File : 获取页面.py
# @Time : 2020/7/19 13:02
# @Software: PyCharm
import requests
a = "http://ntlias-stu.boxuegu.com/#/login" #定义link为目标网易地址
r = requests.get(a)
r.raise_for_status()
r.encoding = r.apparent_encoding
print(... | # -*- coding: utf-8 -*-
# @Time : 2020/7/19 13:02
# @Author : Frosty
# @Email : <EMAIL>
# @File : 获取页面.py
# @Time : 2020/7/19 13:02
# @Software: PyCharm
import requests
a = "http://ntlias-stu.boxuegu.com/#/login" #定义link为目标网易地址
r = requests.get(a)
r.raise_for_status()
r.encoding = r.apparent_encoding
print(... | zh | 0.254938 | # -*- coding: utf-8 -*- # @Time : 2020/7/19 13:02 # @Author : Frosty # @Email : <EMAIL> # @File : 获取页面.py # @Time : 2020/7/19 13:02 # @Software: PyCharm #/login" #定义link为目标网易地址 | 2.120203 | 2 |
Code/options.py | skywolf829/ASMRSR | 4 | 6629575 | <reponame>skywolf829/ASMRSR
import os
import json
class Options():
def get_default():
opt = {}
# Input info
opt["mode"] = "2D" # What SinGAN to use - 2D, 2DTV, or 3D
opt["feat_model"] = "RDN" # What SinGAN to use - 2D or 3D
opt["upsc... | import os
import json
class Options():
def get_default():
opt = {}
# Input info
opt["mode"] = "2D" # What SinGAN to use - 2D, 2DTV, or 3D
opt["feat_model"] = "RDN" # What SinGAN to use - 2D or 3D
opt["upscale_model"] = "LII... | en | 0.854827 | # Input info # What SinGAN to use - 2D, 2DTV, or 3D # What SinGAN to use - 2D or 3D # What SinGAN to use - 2D or 3D # magnitude, channel, learned, none # Folder that the model will be saved to # Spatial downscale ratio between levels # Smallest a dimension can go to upscale from # The day/time the model was trained (fi... | 2.46134 | 2 |
contak/migrations/0001_initial.py | dasfrosty/contak-service | 0 | 6629576 | # Generated by Django 3.1.5 on 2021-01-31 19:08
import django.db.models.deletion
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settin... | # Generated by Django 3.1.5 on 2021-01-31 19:08
import django.db.models.deletion
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settin... | en | 0.813028 | # Generated by Django 3.1.5 on 2021-01-31 19:08 | 1.698571 | 2 |
training/pytorch/structured/custom_containers/gpu/trainer/experiment.py | gogasca/ai-platform-samples-1 | 0 | 6629577 | <filename>training/pytorch/structured/custom_containers/gpu/trainer/experiment.py<gh_stars>0
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the \"License\");
# you may not use this file except in compliance with the License.\n",
# You may obtain a copy of the License at
#
# http://w... | <filename>training/pytorch/structured/custom_containers/gpu/trainer/experiment.py<gh_stars>0
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the \"License\");
# you may not use this file except in compliance with the License.\n",
# You may obtain a copy of the License at
#
# http://w... | en | 0.826408 | # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the \"License\"); # you may not use this file except in compliance with the License.\n", # 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 writ... | 3.018635 | 3 |
flask_turnkey/auth.py | DommertTech/flask-turnkey | 0 | 6629578 | <filename>flask_turnkey/auth.py<gh_stars>0
# Flask-TurnKey Version 0.0.1
# Auth.py
from flask_turboduck.auth import Auth
from app import app, db
from models import User
# Authentication wrapper for TurboDuck
auth = Auth(app, db, user_model=User)
| <filename>flask_turnkey/auth.py<gh_stars>0
# Flask-TurnKey Version 0.0.1
# Auth.py
from flask_turboduck.auth import Auth
from app import app, db
from models import User
# Authentication wrapper for TurboDuck
auth = Auth(app, db, user_model=User)
| en | 0.489926 | # Flask-TurnKey Version 0.0.1 # Auth.py # Authentication wrapper for TurboDuck | 1.688651 | 2 |
tests/test_pabotlib.py | kitschyboy/pabot | 0 | 6629579 | <filename>tests/test_pabotlib.py
import unittest
import os
from pabot import pabotlib
from robot.running.context import EXECUTION_CONTEXTS
from robot.running.namespace import Namespace
from robot.running.model import TestSuite
from robot.variables import Variables
class PabotLibTests(unittest.TestCase):
def setUp... | <filename>tests/test_pabotlib.py
import unittest
import os
from pabot import pabotlib
from robot.running.context import EXECUTION_CONTEXTS
from robot.running.namespace import Namespace
from robot.running.model import TestSuite
from robot.variables import Variables
class PabotLibTests(unittest.TestCase):
def setUp... | en | 0.917934 | # Don't know if this is possible. | 2.535568 | 3 |
ansible/lib/ansible/modules/extras/packaging/os/apk.py | kiv-box/kafka | 0 | 6629580 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, <NAME> <https://github.com/kbrebanov>
# Based on pacman (Afterburn <http://github.com/afterburn>, <NAME> <<EMAIL>>)
# and apt (<NAME> <<EMAIL>>>) modules.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Genera... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, <NAME> <https://github.com/kbrebanov>
# Based on pacman (Afterburn <http://github.com/afterburn>, <NAME> <<EMAIL>>)
# and apt (<NAME> <<EMAIL>>>) modules.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Genera... | en | 0.706808 | #!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, <NAME> <https://github.com/kbrebanov> # Based on pacman (Afterburn <http://github.com/afterburn>, <NAME> <<EMAIL>>) # and apt (<NAME> <<EMAIL>>>) modules. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General... | 1.576836 | 2 |
test_gtcls_ges.py | Wangsj18/ctcx_recognition | 0 | 6629581 | import glob
import tensorflow as tf
import sys
import parameters as pa
import rnn_network
import argparse
import numpy as np
import os
import video_utils as vu
import metrics.edit_distance as ed
import itertools
import time
from tqdm import tqdm
import scipy.spatial.distance as dist
from sklearn.metrics i... | import glob
import tensorflow as tf
import sys
import parameters as pa
import rnn_network
import argparse
import numpy as np
import os
import video_utils as vu
import metrics.edit_distance as ed
import itertools
import time
from tqdm import tqdm
import scipy.spatial.distance as dist
from sklearn.metrics i... | en | 0.597734 | # ['cooc_map', 'jc'] #cls_path = os.path.join(pa.label_abs_folder, base_name + '.csv') # batch_time_feature holder: # batch_time label(classes) holder # b t c(0/1) # TBC to BTC :param label_list: a list of int
:param csv_file:
:return: :param voting_list: a list of int
:return: the most common va... | 1.781272 | 2 |
coding/learn_import/importlib_01_demo.py | yatao91/learning_road | 3 | 6629582 | <filename>coding/learn_import/importlib_01_demo.py
# -*- coding: utf-8 -*-
import importlib
import sys
print(sys.modules)
| <filename>coding/learn_import/importlib_01_demo.py
# -*- coding: utf-8 -*-
import importlib
import sys
print(sys.modules)
| en | 0.769321 | # -*- coding: utf-8 -*- | 1.607624 | 2 |
config.py | maxowner1024/w12scan-client | 0 | 6629583 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/1/21 10:08 PM
# @Author : w8ay
# @File : config.py
# 程序运行的线程数
import os
THREAD_NUM = 25
DEBUG = False
# LOGGER_LEVEL = 1 if DEBUG else 2
LOGGER_LEVEL = 1
# Ip的缓存数量
NUM_CACHE_IP = 77
# 域名的缓存数量
NUM_CACHE_DOMAIN = 2
# Masscan相关
MASSCAN_RATE = 3000 ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/1/21 10:08 PM
# @Author : w8ay
# @File : config.py
# 程序运行的线程数
import os
THREAD_NUM = 25
DEBUG = False
# LOGGER_LEVEL = 1 if DEBUG else 2
LOGGER_LEVEL = 1
# Ip的缓存数量
NUM_CACHE_IP = 77
# 域名的缓存数量
NUM_CACHE_DOMAIN = 2
# Masscan相关
MASSCAN_RATE = 3000 ... | zh | 0.735797 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2019/1/21 10:08 PM # @Author : w8ay # @File : config.py # 程序运行的线程数 # LOGGER_LEVEL = 1 if DEBUG else 2 # Ip的缓存数量 # 域名的缓存数量 # Masscan相关 # masscan 的速率 # 是否扫描全端口 # WEB Restful接口地址 # WEB POCS repository 提供指纹识别对应的poc仓库 # 是否用 plugins目录下的插件进行扫描探,为false将不会进行探测和使用ai... | 1.899176 | 2 |
scripts/chi2014/send_email.py | soyapark-kaist/confer | 1 | 6629584 | #!/usr/bin/python
import sys, os, operator, smtplib, re
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send_email(addr, subject, msg_body):
email_subject = subject
from_addr="<EMAIL>"
to_addr = [addr]
msg = MIMEMultipart()
msg['From'] = 'Confer Team <<EMAIL>>'
... | #!/usr/bin/python
import sys, os, operator, smtplib, re
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send_email(addr, subject, msg_body):
email_subject = subject
from_addr="<EMAIL>"
to_addr = [addr]
msg = MIMEMultipart()
msg['From'] = 'Confer Team <<EMAIL>>'
... | en | 0.937394 | #!/usr/bin/python Dear %s, We're pleased that you're using Confer to mark the papers you want to see at CHI 2014. Did you know Confer can also introduce you to *people* you ought to meet while you're there? Confer has identified a number of individuals whose paper selections suggest that they share your research int... | 3.498651 | 3 |
gfirefly/netconnect/manager.py | handsome3163/H2Dgame-Firefly | 675 | 6629585 | #coding:utf8
'''
Created on 2014-2-23
连接管理器
@author: lan (www.9miao.com)
'''
from gtwisted.utils import log
from connection import Connection
class ConnectionManager:
''' 连接管理器
@param _connections: dict {connID:conn Object}管理的所有连接
'''
def __init__(self):
'''初始化
@param _connections... | #coding:utf8
'''
Created on 2014-2-23
连接管理器
@author: lan (www.9miao.com)
'''
from gtwisted.utils import log
from connection import Connection
class ConnectionManager:
''' 连接管理器
@param _connections: dict {connID:conn Object}管理的所有连接
'''
def __init__(self):
'''初始化
@param _connections... | zh | 0.691325 | #coding:utf8 Created on 2014-2-23 连接管理器 @author: lan (www.9miao.com) 连接管理器 @param _connections: dict {connID:conn Object}管理的所有连接 初始化 @param _connections: dict {connID:conn Object} 获取当前连接数量 加入一条连接 @param _conn: Conn object 更加连接的id删除连接实例 @param connID: int 连接的id 根据ID获取一条连接 @param connI... | 2.42632 | 2 |
trydjango_1/Blog/url.py | KumarPython/Django-Projects | 0 | 6629586 | from django.urls import path
from .views import ArticleListView,ArticleDetailView,ArticleCreateView,ArticleUpdateView,ArticleDeleteView
app_name='blog'
urlpatterns = [
path('', ArticleListView.as_view(), name='article-list'),
path('<int:pk>/', ArticleDetailView.as_view(), name='article-detail'),
path('<int... | from django.urls import path
from .views import ArticleListView,ArticleDetailView,ArticleCreateView,ArticleUpdateView,ArticleDeleteView
app_name='blog'
urlpatterns = [
path('', ArticleListView.as_view(), name='article-list'),
path('<int:pk>/', ArticleDetailView.as_view(), name='article-detail'),
path('<int... | none | 1 | 1.885908 | 2 | |
src/controllers/usuario.py | erickymoreno/Site-Secretaria-de-Obras | 0 | 6629587 | from src import app, db, login_manager
from flask import render_template, redirect, url_for, request, session
from flask_login import login_required, current_user, login_user, logout_user
from src.models.tables import Usuario, Endereco
import bcrypt, sys
@app.route("/cadastro", methods=["GET", "POST"])
def cadastro():... | from src import app, db, login_manager
from flask import render_template, redirect, url_for, request, session
from flask_login import login_required, current_user, login_user, logout_user
from src.models.tables import Usuario, Endereco
import bcrypt, sys
@app.route("/cadastro", methods=["GET", "POST"])
def cadastro():... | none | 1 | 2.613284 | 3 | |
52-54-feedparser/my-code-RSS-feeds/URL_namedtuples.py | Anthlis/My_100_Days_Of_Python | 2 | 6629588 | import collections
Measurement = collections.namedtuple(
'Measurement',
'temp, lat, long, quality')
def get_meas():
data = [
Measurement(11.2, 19.2, 11.1, 'hard'),
Measurement(22.5, 44.234, 19.02, 'strong'),
Measurement(13.5, 2, 3, 'soft'),
]
return data
def main():
... | import collections
Measurement = collections.namedtuple(
'Measurement',
'temp, lat, long, quality')
def get_meas():
data = [
Measurement(11.2, 19.2, 11.1, 'hard'),
Measurement(22.5, 44.234, 19.02, 'strong'),
Measurement(13.5, 2, 3, 'soft'),
]
return data
def main():
... | none | 1 | 3.147843 | 3 | |
fabfile.py | fle-internal/content-provenance | 0 | 6629589 | import json
import os
import time
import requests
from jinja2 import Template
from fabric.api import env, task, local, sudo, run
from fabric.api import get, put, require
from fabric.colors import red, green, blue, yellow
from fabric.context_managers import cd, prefix, show, hide, shell_env
from fabric.contrib.files i... | import json
import os
import time
import requests
from jinja2 import Template
from fabric.api import env, task, local, sudo, run
from fabric.api import get, put, require
from fabric.colors import red, green, blue, yellow
from fabric.context_managers import cd, prefix, show, hide, shell_env
from fabric.contrib.files i... | de | 0.254892 | # PREREQUISITES # 1. SusOps engineer be part of the GCP project kolibri-demo-servers # 2. The username $USER must be one of the default accounts created on instances, see: # https://console.cloud.google.com/compute/metadata?project=kolibri-demo-servers # FAB SETTTINGS ################################################... | 1.708157 | 2 |
pyutils/test_mvm.py | eltrompetero/maxent_fim | 0 | 6629590 | # =============================================================================================== #
# Test module for Median Voter Model.
# Author: <NAME>, <EMAIL>
# =============================================================================================== #
from .mvm import *
from importlib import import_module
... | # =============================================================================================== #
# Test module for Median Voter Model.
# Author: <NAME>, <EMAIL>
# =============================================================================================== #
from .mvm import *
from importlib import import_module
... | en | 0.574623 | # =============================================================================================== # # Test module for Median Voter Model. # Author: <NAME>, <EMAIL> # =============================================================================================== # # couplings do not have to be so accurate to match corre... | 1.96354 | 2 |
runner.py | almightyvaidy/justcheckingin | 0 | 6629591 | <reponame>almightyvaidy/justcheckingin
# -*- coding: utf-8 -*-
"""
Created on Thu May 6 11:36:44 2021
@author: vaidy
"""
# what the the external dat input that need to supplied to the objects instatiated using this class
class runner:
def __init__(self,x):
return self
def health():
... | # -*- coding: utf-8 -*-
"""
Created on Thu May 6 11:36:44 2021
@author: vaidy
"""
# what the the external dat input that need to supplied to the objects instatiated using this class
class runner:
def __init__(self,x):
return self
def health():
return
def sleep():
retur... | en | 0.87715 | # -*- coding: utf-8 -*- Created on Thu May 6 11:36:44 2021
@author: vaidy # what the the external dat input that need to supplied to the objects instatiated using this class # call ditance becasue the you increase distance when you run # you get tired when you run # you lose energy while running # your joints get ... | 3.178951 | 3 |
var/spack/repos/builtin/packages/krims/package.py | LiamBindle/spack | 2,360 | 6629592 | <filename>var/spack/repos/builtin/packages/krims/package.py
# Copyright 2013-2021 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 Krims(CMakePackage):
"""The bu... | <filename>var/spack/repos/builtin/packages/krims/package.py
# Copyright 2013-2021 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 Krims(CMakePackage):
"""The bu... | en | 0.712513 | # Copyright 2013-2021 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) The bucket of Krimskrams every C or C++ project needs # # Versions # # # Variants # # Library build type # Components # # C... | 1.48622 | 1 |
carlo/restrictions.py | ahitrin/carlo | 0 | 6629593 | <reponame>ahitrin/carlo
def eq(first, second):
return (first, second)
def ge(first, second):
pass
def cardinal_many(*args):
pass
| def eq(first, second):
return (first, second)
def ge(first, second):
pass
def cardinal_many(*args):
pass | none | 1 | 1.993688 | 2 | |
esphome/cpp_helpers.py | OttoWinter/esphomeyaml | 249 | 6629594 | import logging
from esphome.const import (
CONF_DISABLED_BY_DEFAULT,
CONF_ENTITY_CATEGORY,
CONF_ICON,
CONF_INTERNAL,
CONF_NAME,
CONF_SETUP_PRIORITY,
CONF_UPDATE_INTERVAL,
CONF_TYPE_ID,
)
# pylint: disable=unused-import
from esphome.core import coroutine, ID, CORE
from esphome.types imp... | import logging
from esphome.const import (
CONF_DISABLED_BY_DEFAULT,
CONF_ENTITY_CATEGORY,
CONF_ICON,
CONF_INTERNAL,
CONF_NAME,
CONF_SETUP_PRIORITY,
CONF_UPDATE_INTERVAL,
CONF_TYPE_ID,
)
# pylint: disable=unused-import
from esphome.core import coroutine, ID, CORE
from esphome.types imp... | en | 0.756162 | # pylint: disable=unused-import Generate an expression for the given pin option. This is a coroutine, you must await it with a 'await' expression! Register the given obj as a component. This is a coroutine, you must await it with a 'await' expression! :param var: The variable representing the component. ... | 1.995244 | 2 |
survey_bot/bot_admin/migrations/0003_auto_20211019_0858.py | eisichenko/Survey-Service | 0 | 6629595 | # Generated by Django 3.2.7 on 2021-10-19 08:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bot_admin', '0002_telegrampoll_options_text'),
]
operations = [
migrations.AlterField(
model_name='student',
name='g... | # Generated by Django 3.2.7 on 2021-10-19 08:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bot_admin', '0002_telegrampoll_options_text'),
]
operations = [
migrations.AlterField(
model_name='student',
name='g... | en | 0.856759 | # Generated by Django 3.2.7 on 2021-10-19 08:58 | 1.62802 | 2 |
maquinaria/alquileres/views/__init__.py | CFredy9/Maquinaria | 0 | 6629596 | from .alquileres import * | from .alquileres import * | none | 1 | 1.266523 | 1 | |
src/odinapi/views/read_smiles.py | Odin-SMR/odin-api | 0 | 6629597 | from datetime import datetime
from dateutil.relativedelta import relativedelta
from h5py import File
import numpy as np
def read_smiles_file(
file, date, species, file_index,
smiles_basepath_pattern='/vds-data/ISS_SMILES_Level2/{0}/v2.4',
):
file_index = int(file_index)
smiles_datapath = smiles_base... | from datetime import datetime
from dateutil.relativedelta import relativedelta
from h5py import File
import numpy as np
def read_smiles_file(
file, date, species, file_index,
smiles_basepath_pattern='/vds-data/ISS_SMILES_Level2/{0}/v2.4',
):
file_index = int(file_index)
smiles_datapath = smiles_base... | en | 0.771378 | # transform the mls date to MJD and add to dict # select data from the given index | 2.301073 | 2 |
bin/mkjsonapi.py | bd4/monster-hunter-scripts | 2 | 6629598 | <reponame>bd4/monster-hunter-scripts
#!/usr/bin/env python3
import os
import json
import sys
import errno
import urllib.request, urllib.parse, urllib.error
import argparse
import _pathfix
from mhapi.db import MHDB
from mhapi import model
ENTITIES = """item weapon monster armor
skilltree skill decorati... | #!/usr/bin/env python3
import os
import json
import sys
import errno
import urllib.request, urllib.parse, urllib.error
import argparse
import _pathfix
from mhapi.db import MHDB
from mhapi import model
ENTITIES = """item weapon monster armor
skilltree skill decoration
horn_melody wyporium... | en | 0.39181 | #!/usr/bin/env python3 item weapon monster armor skilltree skill decoration horn_melody wyporium # only 143 rows, just do index with all data | 2.680153 | 3 |
test_pe_core/test_compute_unit.py | zbelateche/ee272_cgra | 1 | 6629599 | import glob
import pytest
import pe
import fault
import os
from random import randint
import inspect
from pe_core import pe_core_genesis2
import glob
import itertools
import magma as m
# Generate the PE
pe_core = pe_core_genesis2.pe_core_wrapper.generator()()
pe_compute_unit = m.DefineFromVerilogFile(
'genesis_ver... | import glob
import pytest
import pe
import fault
import os
from random import randint
import inspect
from pe_core import pe_core_genesis2
import glob
import itertools
import magma as m
# Generate the PE
pe_core = pe_core_genesis2.pe_core_wrapper.generator()()
pe_compute_unit = m.DefineFromVerilogFile(
'genesis_ver... | en | 0.327374 | # Generate the PE # Cleanup PE genesis2 collateral | 1.87233 | 2 |
src/cfnlint/rules/resources/properties/VpcId.py | LukasMusebrink/cfn-python-lint | 0 | 6629600 | <filename>src/cfnlint/rules/resources/properties/VpcId.py
"""
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
withou... | <filename>src/cfnlint/rules/resources/properties/VpcId.py
"""
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
withou... | en | 0.73976 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, c... | 2.169868 | 2 |
var/spack/repos/builtin/packages/py-spacy-models-en-core-web-sm/package.py | jeanbez/spack | 0 | 6629601 | <reponame>jeanbez/spack
# Copyright 2013-2022 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.package import *
class PySpacyModelsEnCoreWebSm(PythonPackage):
"""English multi... | # Copyright 2013-2022 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.package import *
class PySpacyModelsEnCoreWebSm(PythonPackage):
"""English multi-task CNN trained on Ont... | en | 0.656869 | # Copyright 2013-2022 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) English multi-task CNN trained on OntoNotes. Assigns context-specific token vectors, POS tags, dependency parse and nam... | 1.44223 | 1 |
mitmproxy/addons/proxyserver.py | chenzhenguo/mitmproxy | 2 | 6629602 | import asyncio
import warnings
from typing import Optional
from mitmproxy import controller, ctx, flow, log, master, options, platform
from mitmproxy.flow import Error
from mitmproxy.proxy import commands
from mitmproxy.proxy import server
from mitmproxy.utils import asyncio_utils, human
class AsyncReply(controller.... | import asyncio
import warnings
from typing import Optional
from mitmproxy import controller, ctx, flow, log, master, options, platform
from mitmproxy.flow import Error
from mitmproxy.proxy import commands
from mitmproxy.proxy import server
from mitmproxy.utils import asyncio_utils, human
class AsyncReply(controller.... | en | 0.794092 | controller.Reply.q.get() is blocking, which we definitely want to avoid in a coroutine. This stub adds a .done asyncio.Event() that can be used instead. # pragma: no cover # event loop may already be closed. # pragma: no cover # We currently only support single-argument hooks. # type: ignore This addon runs the act... | 2.055914 | 2 |
test.py | Sanjana7395/face_segmentation | 22 | 6629603 | import os
import numpy as np
import cv2
import argparse
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import seaborn as sns
from tensorflow.keras import Input
from model import u_net
from preprocessing.preprocess_utils import display
from experiments import lip_hair_color
def make_confu... | import os
import numpy as np
import cv2
import argparse
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import seaborn as sns
from tensorflow.keras import Input
from model import u_net
from preprocessing.preprocess_utils import display
from experiments import lip_hair_color
def make_confu... | en | 0.500422 | Code to generate text within each box and beautify confusion matrix. :param cf: Confusion matrix. :type cf: numpy array :param categories: array of classes. :type categories: numpy array :param group_names: classes in the project. :type group_names: numpy array :param count: whether to disp... | 3.079378 | 3 |
src/new_main.py | lorespaul/TextRecognition | 0 | 6629604 | import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
import cv2
from scipy import ndimage
from os import path, sys
from FilePaths import FilePaths
from DataLoader import DataLoader, Batch
from WordsLoaderDataset import WordsLoaderDataset
from SamplePrepro... | import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
import cv2
from scipy import ndimage
from os import path, sys
from FilePaths import FilePaths
from DataLoader import DataLoader, Batch
from WordsLoaderDataset import WordsLoaderDataset
from SamplePrepro... | en | 0.248393 | # def show_first_image(): # img = preprocess(cv2.imread(FilePaths.fnInfer, cv2.IMREAD_GRAYSCALE), (128, 32)) # # img = preprocess(cv2.imread('../data/words/a01/a01-000u/a01-000u-01-02.png', cv2.IMREAD_GRAYSCALE), (128, 32)) # plt.figure() # plt.imshow(img, cmap=plt.cm.binary) # plt.colorbar() # ... | 2.556963 | 3 |
setup.py | suAdminWen/cc-api | 6 | 6629605 | from setuptools import find_packages, setup
with open('README.md', 'rb') as f:
long_description = f.read().decode('utf-8')
with open('requirements-prod.txt') as f:
requirements = [l for l in f.read().splitlines() if l]
setup(
name='flask_cc_api',
version='0.9.0.dev1',
description="libs for flask... | from setuptools import find_packages, setup
with open('README.md', 'rb') as f:
long_description = f.read().decode('utf-8')
with open('requirements-prod.txt') as f:
requirements = [l for l in f.read().splitlines() if l]
setup(
name='flask_cc_api',
version='0.9.0.dev1',
description="libs for flask... | fr | 0.126668 | [console_scripts] flask_cc_api=flask_cc_api.cli.main:cli | 1.377354 | 1 |
deepnlp/__init__.py | taishanfuxiao/NLP- | 1,440 | 6629606 | <reponame>taishanfuxiao/NLP-<filename>deepnlp/__init__.py<gh_stars>1000+
""" Deepnlp Package """
from __future__ import unicode_literals
__version__ = '0.1.7'
__license__ = 'MIT'
from deepnlp import downloader
from deepnlp import model_util
# global function for download pre-trained model from github
# https://githu... | """ Deepnlp Package """
from __future__ import unicode_literals
__version__ = '0.1.7'
__license__ = 'MIT'
from deepnlp import downloader
from deepnlp import model_util
# global function for download pre-trained model from github
# https://github.com/rockingdingo
download = downloader.download
register_model = model_... | en | 0.748069 | Deepnlp Package # global function for download pre-trained model from github # https://github.com/rockingdingo | 1.755931 | 2 |
tests/integration_tests/test_api.py | hfurkanbozkurt/ludwig | 0 | 6629607 | # Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | # Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | en | 0.722161 | # Copyright (c) 2019 Uber Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed... | 2.172477 | 2 |
example/h2o_angle.py | NLESC-JCER/DeepQMC | 6 | 6629608 | import numpy as np
from deepqmc.wavefunction.wf_orbital import Orbital
from deepqmc.solver.solver_orbital import SolverOrbital
from deepqmc.sampler.metropolis import Metropolis
from deepqmc.wavefunction.molecule import Molecule
def rot_mat(angles):
dA = (angles[1]-angles[0])*np.pi/180
c, s = np.cos(dA), np.... | import numpy as np
from deepqmc.wavefunction.wf_orbital import Orbital
from deepqmc.solver.solver_orbital import SolverOrbital
from deepqmc.sampler.metropolis import Metropolis
from deepqmc.wavefunction.molecule import Molecule
def rot_mat(angles):
dA = (angles[1]-angles[0])*np.pi/180
c, s = np.cos(dA), np.... | en | 0.421635 | # define the molecule # define the wave function # sampler # solver # define the wave function # bend the mol | 2.461828 | 2 |
sjfxsz/codes/chap6.py | SaronZhou/python | 0 | 6629609 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 19:50:38 2019
@author: admin
"""
import numpy as np
import pandas as pd
### pandas数据处理 ###
# 数据准备、数据转换、数据聚合
## 数据准备 ##
# 加载、组装:合并,拼接,组合、变形(轴向旋转)、删除
# 合并 #
# merge()函数
frame1 = pd.DataFrame({'id':['ball','pencil','pen','mug','ashtray'],
'price... | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 19:50:38 2019
@author: admin
"""
import numpy as np
import pandas as pd
### pandas数据处理 ###
# 数据准备、数据转换、数据聚合
## 数据准备 ##
# 加载、组装:合并,拼接,组合、变形(轴向旋转)、删除
# 合并 #
# merge()函数
frame1 = pd.DataFrame({'id':['ball','pencil','pen','mug','ashtray'],
'price... | zh | 0.944465 | # -*- coding: utf-8 -*- Created on Tue Feb 26 19:50:38 2019 @author: admin ### pandas数据处理 ### # 数据准备、数据转换、数据聚合 ## 数据准备 ## # 加载、组装:合并,拼接,组合、变形(轴向旋转)、删除 # 合并 # # merge()函数 # 合并frame1与frame2 # 指定基于哪一列合并,增加on选项 # frame1与frame2有两个相同列名的列,对其执行合并操作得到空DataFrame对象 # 指定其合并操作标准 # 使用left_on和right_on指定frame1和frame2的基准列,即以frame1中id与... | 2.65185 | 3 |
prueba.py | marlonvillaverde/condominio | 0 | 6629610 | ' primero tenemos la lista con los diccionarios de atletas y el pais'
lista = []
lista.append( { 'nombre': 'Aaron', 'pais': 'Argentina'} )
lista.append( { 'nombre': 'Alain', 'pais': 'Alemania'} )
lista.append( { 'nombre': 'Juan', 'pais': 'Argelia'} )
lista.append( { 'nombre': 'Clevey', 'pais': 'Austria'} )
lista.append... | ' primero tenemos la lista con los diccionarios de atletas y el pais'
lista = []
lista.append( { 'nombre': 'Aaron', 'pais': 'Argentina'} )
lista.append( { 'nombre': 'Alain', 'pais': 'Alemania'} )
lista.append( { 'nombre': 'Juan', 'pais': 'Argelia'} )
lista.append( { 'nombre': 'Clevey', 'pais': 'Austria'} )
lista.append... | none | 1 | 3.684686 | 4 | |
use_cases/MarzV3/backend/marzv2/admin.py | einshoe/ssv-examples | 0 | 6629611 | <reponame>einshoe/ssv-examples<filename>use_cases/MarzV3/backend/marzv2/admin.py
from django.contrib import admin
# Register your models here.
# Register your models here.
from .models import FitsFiles
from .models import JsonFiles
from .models import TemplateSpectra
from .models import EmissionSpectra
admin.site.re... | from django.contrib import admin
# Register your models here.
# Register your models here.
from .models import FitsFiles
from .models import JsonFiles
from .models import TemplateSpectra
from .models import EmissionSpectra
admin.site.register(FitsFiles)
admin.site.register(JsonFiles)
admin.site.register(TemplateSpec... | en | 0.969169 | # Register your models here. # Register your models here. | 1.361419 | 1 |
opus/application/apps/help/test_help.py | fyellin/pds-opus | 10 | 6629612 | # help/test_help.py
import logging
from unittest import TestCase
from django.core.cache import cache
from django.http import Http404
from django.test import RequestFactory
from help.views import (api_about,
api_citing_opus,
api_api_guide,
api_fa... | # help/test_help.py
import logging
from unittest import TestCase
from django.core.cache import cache
from django.http import Http404
from django.test import RequestFactory
from help.views import (api_about,
api_citing_opus,
api_api_guide,
api_fa... | de | 0.784306 | # help/test_help.py ######################################## ######### api_about UNIT TESTS ######### ######################################## ########################################## ######### api_volumes UNIT TESTS ######### ########################################## ###################################### #########... | 2.125292 | 2 |
setup.py | simbuerg/benchbuild | 0 | 6629613 | <filename>setup.py
#!/usr/bin/env python3
from setuptools import setup, find_packages
extra_files = [
"templates/compiler.py.inc",
"templates/run_static.py.inc",
"templates/run_dynamic.py.inc",
"templates/slurm-prepare-node.sh.inc",
"templates/slurm-cleanup-node.sh.inc"
]
sql_extra_files = [
"... | <filename>setup.py
#!/usr/bin/env python3
from setuptools import setup, find_packages
extra_files = [
"templates/compiler.py.inc",
"templates/run_static.py.inc",
"templates/run_dynamic.py.inc",
"templates/slurm-prepare-node.sh.inc",
"templates/slurm-cleanup-node.sh.inc"
]
sql_extra_files = [
"... | fr | 0.221828 | #!/usr/bin/env python3 | 1.256367 | 1 |
steemd-export/etc/unicode.py | metaperl/vivacoin | 0 | 6629614 | <reponame>metaperl/vivacoin
import pprint
a = u'bats\u00E0'
pprint.pformat(a) # Works
str(a) # Works
print(a) # UnicodeEncodeError: 'ascii' codec can't encode character '\xe0' in position 4: ordinal not in range(128)
| import pprint
a = u'bats\u00E0'
pprint.pformat(a) # Works
str(a) # Works
print(a) # UnicodeEncodeError: 'ascii' codec can't encode character '\xe0' in position 4: ordinal not in range(128) | en | 0.665277 | # Works # Works # UnicodeEncodeError: 'ascii' codec can't encode character '\xe0' in position 4: ordinal not in range(128) | 2.597328 | 3 |
code.py | git-gagan/python-mini-challenges | 0 | 6629615 | # --------------
#Code starts here
'''def palindrome(num):
while(num):
num=int(num)+1
num=str(num)
if num[::-1]==num:
return num
res=palindrome(13456)
print(res)'''
#Function to check for palindrome
def palindrome_check(num):
num=str(num)
return (num[::-1]==nu... | # --------------
#Code starts here
'''def palindrome(num):
while(num):
num=int(num)+1
num=str(num)
if num[::-1]==num:
return num
res=palindrome(13456)
print(res)'''
#Function to check for palindrome
def palindrome_check(num):
num=str(num)
return (num[::-1]==nu... | en | 0.38884 | # -------------- #Code starts here def palindrome(num):
while(num):
num=int(num)+1
num=str(num)
if num[::-1]==num:
return num
res=palindrome(13456)
print(res) #Function to check for palindrome #Function to find the smallest palindrome # -------------- #Code starts here #... | 3.716428 | 4 |
init_repo.py | Serfentum/xcms_finder | 0 | 6629616 | <reponame>Serfentum/xcms_finder
from pathlib import Path
import git
def init_repo(repo_clone_url, path, version):
"""
Clone repo from url to specified path, dir with it will be named as version
:param repo_clone_url: str - url from gihub to clone
:param path: str - path, where dir with repo will be p... | from pathlib import Path
import git
def init_repo(repo_clone_url, path, version):
"""
Clone repo from url to specified path, dir with it will be named as version
:param repo_clone_url: str - url from gihub to clone
:param path: str - path, where dir with repo will be places
:param version: str - ... | en | 0.749447 | Clone repo from url to specified path, dir with it will be named as version :param repo_clone_url: str - url from gihub to clone :param path: str - path, where dir with repo will be places :param version: str - future name of repo dir :return: git.repo.base.Repo, str - repository object and path to the ... | 3.118162 | 3 |
lib/model/faster_rcnn/tracking_utils.py | lzhangbj/Tracking | 0 | 6629617 | import torch
import numpy as np
EPISILON = 1e-6
# we can track dynamic infomation
# naively, we can also directly insert all information into LSTM
def TrackingDynamicInfos(prevROIFeature, prevROI, currROIFeature, currROI, kernel=5):
'''
calculate the dynamic movement info and feed into our TrackingLocGRU
input l... | import torch
import numpy as np
EPISILON = 1e-6
# we can track dynamic infomation
# naively, we can also directly insert all information into LSTM
def TrackingDynamicInfos(prevROIFeature, prevROI, currROIFeature, currROI, kernel=5):
'''
calculate the dynamic movement info and feed into our TrackingLocGRU
input l... | en | 0.523442 | # we can track dynamic infomation # naively, we can also directly insert all information into LSTM calculate the dynamic movement info and feed into our TrackingLocGRU input length are all tracking module capacity input features should be the same shape for convenience we use the matchTrans principle here. input... | 2.854706 | 3 |
chirp/library/import_transaction.py | chirpradio/chirpradio-machine | 8 | 6629618 | import os
import sys
from chirp.common.printing import cprint
from chirp.library import album
from chirp.library import audio_file
from chirp.library import import_file
from chirp.library import ufid
class ImportTransaction(object):
def __init__(self, db, volume, import_timestamp, tmp_prefix,
d... | import os
import sys
from chirp.common.printing import cprint
from chirp.library import album
from chirp.library import audio_file
from chirp.library import import_file
from chirp.library import ufid
class ImportTransaction(object):
def __init__(self, db, volume, import_timestamp, tmp_prefix,
d... | en | 0.882771 | # Plug in the volume and import timestamp for this transaction. # Write the files to our temporary prefix. # Might raise an ImportFileError. # We forget the payloads immediately to save RAM. # Everything checks out! # Start a database transaction to add the files. # Write each new file into the database. # Strip off tr... | 2.420492 | 2 |
src/strategy.py | tobby2002/ebisu | 0 | 6629619 | <reponame>tobby2002/ebisu<filename>src/strategy.py
# coding: UTF-8
import os
import random
import math
import re
import numpy
import time
from hyperopt import hp
from src import highest, lowest, sma, crossover, crossunder, over, under, last, rci, rsi, double_ema, ema, triple_ema, wma, \
ssma, hull, logger, notify, ... | # coding: UTF-8
import os
import random
import math
import re
import numpy
import time
from hyperopt import hp
from src import highest, lowest, sma, crossover, crossunder, over, under, last, rci, rsi, double_ema, ema, triple_ema, wma, \
ssma, hull, logger, notify, atr, willr, bbands, supertrend, heikinashi
from src... | en | 0.32305 | # coding: UTF-8 # logger.info('strategy start ctime : %s' % time.ctime()) # start = time.time() # 시작 시간 저장 # lot = self.exchange.get_lot() # willr for five willilams # logger.info('---- a ----') # for i in range(1, 5): # logger.info('a [%s] *******: %s' % (-i, a[-i])) # logger.info('---- b ----') # for i in range(... | 2.063665 | 2 |
tests/ut/python/exec/resnet_example.py | unseenme/mindspore | 2 | 6629620 | <reponame>unseenme/mindspore<gh_stars>1-10
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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
#
# Unl... | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | en | 0.777406 | # Copyright 2020 Huawei Technologies Co., Ltd # # 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... | 2.312243 | 2 |
youdao.py | bobbyesh/youdao-wrapper | 0 | 6629621 | <reponame>bobbyesh/youdao-wrapper<filename>youdao.py<gh_stars>0
# api.py
'''Defines a YouDaoAPI class for accessing the public
youdao.com api.
Instantiating With API Key
==========================
>>> youdao = YouDaoAPI(keyfrom, key)
Instantiating With Config File
==============================
Create a keys.ini ... | # api.py
'''Defines a YouDaoAPI class for accessing the public
youdao.com api.
Instantiating With API Key
==========================
>>> youdao = YouDaoAPI(keyfrom, key)
Instantiating With Config File
==============================
Create a keys.ini in the following format,
replace <keyfrom> and <key> with the ke... | en | 0.697633 | # api.py Defines a YouDaoAPI class for accessing the public youdao.com api. Instantiating With API Key ========================== >>> youdao = YouDaoAPI(keyfrom, key) Instantiating With Config File ============================== Create a keys.ini in the following format, replace <keyfrom> and <key> with the keyfr... | 3.311736 | 3 |
PyMoCapViewer/skeletons/__init__.py | justamad/PyMoCapViewer | 1 | 6629622 | <gh_stars>1-10
from .skeleton_loader import get_skeleton_definition_for_camera
| from .skeleton_loader import get_skeleton_definition_for_camera | none | 1 | 1.09642 | 1 | |
AssistantControl/google_home_led_pattern.py | cwalker/Assistants | 28 | 6629623 | <reponame>cwalker/Assistants
#!/usr/bin/env python
def GoogleHomeLedPattern(show):
basis = [0] * 3 * 3
basis[0] = 1
basis[4] = 1
basis[8] = 2
return basis
| #!/usr/bin/env python
def GoogleHomeLedPattern(show):
basis = [0] * 3 * 3
basis[0] = 1
basis[4] = 1
basis[8] = 2
return basis | ru | 0.26433 | #!/usr/bin/env python | 2.581985 | 3 |
Pytorch/config.py | khshayarr/DREAM-1 | 44 | 6629624 | <reponame>khshayarr/DREAM-1
# -*- coding:utf-8 -*-
__author__ = 'Randolph'
class Config(object):
def __init__(self):
self.TRAININGSET_DIR = '../data/Train.json'
self.VALIDATIONSET_DIR = '../data/Validation.json'
self.TESTSET_DIR = '../data/Test.json'
self.NEG_SAMPLES = '../data/neg... | # -*- coding:utf-8 -*-
__author__ = 'Randolph'
class Config(object):
def __init__(self):
self.TRAININGSET_DIR = '../data/Train.json'
self.VALIDATIONSET_DIR = '../data/Validation.json'
self.TESTSET_DIR = '../data/Test.json'
self.NEG_SAMPLES = '../data/neg_sample.pickle'
self... | en | 0.525711 | # -*- coding:utf-8 -*- # Initial Learning Rate # num of batches between two logging # ['avg', 'max'] # ['RNN_TANH', 'RNN_RELU', 'LSTM', 'GRU'] # 商品数目,用于定义 Embedding Layer # 商品表征维数, 用于定义 Embedding Layer # 负采样个数 # Top K 取值 | 2.230546 | 2 |
Router.py | bachnguyenhuu/RENAT | 65 | 6629625 | <filename>Router.py<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright 2017-2020 NTT Communications
#
# 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/license... | <filename>Router.py<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright 2017-2020 NTT Communications
#
# 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/license... | en | 0.703923 | # -*- coding: utf-8 -*- # Copyright 2017-2020 NTT Communications # # 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 b... | 2.06172 | 2 |
Node_init.py | dugdmitry/adhoc_routing | 26 | 6629626 | <filename>Node_init.py<gh_stars>10-100
#!/usr/bin/python
"""
@package Node_init
Created on Sep 25, 2014
@author: <NAME>
This module is a starting point of the program. It performs two main operations - first, provides methods for correctly
daemonizing the application after start, second, provides the main initializa... | <filename>Node_init.py<gh_stars>10-100
#!/usr/bin/python
"""
@package Node_init
Created on Sep 25, 2014
@author: <NAME>
This module is a starting point of the program. It performs two main operations - first, provides methods for correctly
daemonizing the application after start, second, provides the main initializa... | en | 0.737475 | #!/usr/bin/python @package Node_init Created on Sep 25, 2014 @author: <NAME> This module is a starting point of the program. It performs two main operations - first, provides methods for correctly daemonizing the application after start, second, provides the main initialization point for all supporting threads and h... | 2.491256 | 2 |
Scripts/core/native/animation/arb.py | velocist/TS4CheatsInfo | 0 | 6629627 | <reponame>velocist/TS4CheatsInfo<filename>Scripts/core/native/animation/arb.py
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Core\native\animation\arb.py... | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Core\native\animation\arb.py
# Compiled at: 2017-08-04 23:38:31
# Size of source mod 2**32: 18313 bytes
fro... | en | 0.48796 | # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Core\native\animation\arb.py # Compiled at: 2017-08-04 23:38:31 # Size of source mod 2**32: 18313 bytes | 1.915517 | 2 |
src/Practice/Algorithms/Greedy/Minimum Absolute Difference in an Array.py | neelkamath/hackerrank-solutions | 0 | 6629628 | <gh_stars>0
#!/bin/python3
import math
import os
import random
import re
import sys
def minimumAbsoluteDifference(arr):
arr.sort()
minimum = 1e9
for index, num in enumerate(arr[:len(arr) - 1]):
newMin = abs(num - arr[index + 1])
if newMin < minimum:
minimum = newMin
return... | #!/bin/python3
import math
import os
import random
import re
import sys
def minimumAbsoluteDifference(arr):
arr.sort()
minimum = 1e9
for index, num in enumerate(arr[:len(arr) - 1]):
newMin = abs(num - arr[index + 1])
if newMin < minimum:
minimum = newMin
return minimum
i... | ru | 0.16812 | #!/bin/python3 | 3.089164 | 3 |
team/games/__init__.py | ReubenJ/ulti_stats | 0 | 6629629 | <filename>team/games/__init__.py
from .game import Game
from .point import Point
| <filename>team/games/__init__.py
from .game import Game
from .point import Point
| none | 1 | 1.153423 | 1 | |
tests/functional/Surfaces/Surface.py | jmikeowen/Spheral | 22 | 6629630 | <filename>tests/functional/Surfaces/Surface.py
#ATS:t1 = test( SELF, "--CRKSPH True --cfl 0.25 --clearDirectories True --steps=2 --nx=50 --ny=50 --checkAnswer=True --detectSurfaces=True --detectThreshold=0.99 --sweepAngle=pi/4.0 --detectRange=2.0", label="Surface Detection Test -- 2-D (serial)")
from math import... | <filename>tests/functional/Surfaces/Surface.py
#ATS:t1 = test( SELF, "--CRKSPH True --cfl 0.25 --clearDirectories True --steps=2 --nx=50 --ny=50 --checkAnswer=True --detectSurfaces=True --detectThreshold=0.99 --sweepAngle=pi/4.0 --detectRange=2.0", label="Surface Detection Test -- 2-D (serial)")
from math import... | en | 0.135963 | #ATS:t1 = test( SELF, "--CRKSPH True --cfl 0.25 --clearDirectories True --steps=2 --nx=50 --ny=50 --checkAnswer=True --detectSurfaces=True --detectThreshold=0.99 --sweepAngle=pi/4.0 --detectRange=2.0", label="Surface Detection Test -- 2-D (serial)") #self.renormMat() # this could be done better #-----------------... | 2.26308 | 2 |
geni-lib/samples/userdata.py | AERPAW-Platform-Control/gateway | 0 | 6629631 | <reponame>AERPAW-Platform-Control/gateway
#!/usr/bin/env python
import geni.portal as portal
import geni.rspec.pg as rspec
import geni.rspec.igext as IG
import geni.rspec.emulab as emulab
from lxml import etree as ET
pc = portal.Context()
request = rspec.Request()
pc.defineParameter("param1", "dsc1", portal.Paramet... | #!/usr/bin/env python
import geni.portal as portal
import geni.rspec.pg as rspec
import geni.rspec.igext as IG
import geni.rspec.emulab as emulab
from lxml import etree as ET
pc = portal.Context()
request = rspec.Request()
pc.defineParameter("param1", "dsc1", portal.ParameterType.INTEGER, 1)
pc.defineParameter("par... | en | 0.840745 | #!/usr/bin/env python # Add user data to node1 in a single line # Add user data to link over several lines | 2.253593 | 2 |
project/routes.py | DillonEnge/tack-board-api | 0 | 6629632 | <filename>project/routes.py
from project import views
def setup_routes(app):
@app.listener('before_server_start')
def init_routes(app, loop):
app.add_route(views.EventsView.as_view(), '/events')
app.add_route(views.TagsView.as_view(), '/tags')
app.add_route(views.ProfilesView.as_view()... | <filename>project/routes.py
from project import views
def setup_routes(app):
@app.listener('before_server_start')
def init_routes(app, loop):
app.add_route(views.EventsView.as_view(), '/events')
app.add_route(views.TagsView.as_view(), '/tags')
app.add_route(views.ProfilesView.as_view()... | none | 1 | 2.244296 | 2 | |
templates/tencent-flask/app.py | timqian/components | 0 | 6629633 | # -*- coding: utf8 -*-
import json
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route("/")
def index():
return "Hello Flask"
@app.route('/user', methods = ['POST'])
def addUser():
# we must get request body from clound function event;
event = request.environ['event']
user = j... | # -*- coding: utf8 -*-
import json
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route("/")
def index():
return "Hello Flask"
@app.route('/user', methods = ['POST'])
def addUser():
# we must get request body from clound function event;
event = request.environ['event']
user = j... | en | 0.743448 | # -*- coding: utf8 -*- # we must get request body from clound function event; | 3.115031 | 3 |
elasticsearch/_async/client/fleet.py | Conky5/elasticsearch-py | 4 | 6629634 | <gh_stars>1-10
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you ... | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | en | 0.839862 | # Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ... | 1.948322 | 2 |
tests/GUI/test_scan_viewer.py | nhsx-mirror/skunkworks-ct-alignment-lesion-detection | 2 | 6629635 | <filename>tests/GUI/test_scan_viewer.py<gh_stars>1-10
import mock
import numpy as np
import pytest
import pyqtgraph as pg
import pyqtgraph.opengl as gl
from PySide2.QtWidgets import QVBoxLayout, QWidget, QSizePolicy
from ai_ct_scans.GUI import ScanViewer
from ai_ct_scans.GUI.scan_viewer import SCAN_COLOURS
class Tes... | <filename>tests/GUI/test_scan_viewer.py<gh_stars>1-10
import mock
import numpy as np
import pytest
import pyqtgraph as pg
import pyqtgraph.opengl as gl
from PySide2.QtWidgets import QVBoxLayout, QWidget, QSizePolicy
from ai_ct_scans.GUI import ScanViewer
from ai_ct_scans.GUI.scan_viewer import SCAN_COLOURS
class Tes... | en | 0.770385 | # Unknown if this can be checked natively without patching. # Unknown if this can be checked natively without patching. # Shape should be x, y, z, RGBA # Unknown if this can be checked natively without patching. # Unknown if this can be checked natively without patching. # Shape should be x, y, z, RGBA | 2.118635 | 2 |
trseeker/tools/trs_groups.py | ad3002/Lyrebird | 0 | 6629636 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#@created: 07.09.2011
#@author: <NAME>
#@contact: <EMAIL>
'''
Functions related to TRs group analysis.
'''
from trseeker.tools.statistics import get_mean
def get_index(i):
''' Get next family index.'''
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if i<len(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#@created: 07.09.2011
#@author: <NAME>
#@contact: <EMAIL>
'''
Functions related to TRs group analysis.
'''
from trseeker.tools.statistics import get_mean
def get_index(i):
''' Get next family index.'''
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if i<len(... | en | 0.764794 | #!/usr/bin/env python # -*- coding: utf-8 -*- # #@created: 07.09.2011 #@author: <NAME> #@contact: <EMAIL> Functions related to TRs group analysis. Get next family index. Get most frequent element of list. Get unit and letter for family. # read units to pmatch # find optimal unit # change unit Join families with common ... | 3.554101 | 4 |
vkwave/api/methods/leads.py | XIDY-Dex/vkwave | 222 | 6629637 | from vkwave.types.responses import *
from ._category import Category
from ._utils import get_params
class Leads(Category):
async def check_user(
self,
lead_id: int,
return_raw_response: bool = False,
test_result: typing.Optional[int] = None,
test_mode: typing.Optional[bool]... | from vkwave.types.responses import *
from ._category import Category
from ._utils import get_params
class Leads(Category):
async def check_user(
self,
lead_id: int,
return_raw_response: bool = False,
test_result: typing.Optional[int] = None,
test_mode: typing.Optional[bool]... | en | 0.58122 | :param lead_id: - Lead ID. :param test_result: - Value to be return in 'result' field when test mode is used. :param test_mode: :param auto_start: :param age: - User age. :param country: - User country code. :param return_raw_response: - return result at dict :ret... | 2.042422 | 2 |
p322_Coin_Change.py | bzhou26/leetcode_sol | 0 | 6629638 | '''
- Leetcode problem: 322
- Difficulty: Medium
- Brief problem description:
You are given coins of different denominations and a total amount of money amount. Write a function to compute the
fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any
combination of... | '''
- Leetcode problem: 322
- Difficulty: Medium
- Brief problem description:
You are given coins of different denominations and a total amount of money amount. Write a function to compute the
fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any
combination of... | en | 0.789325 | - Leetcode problem: 322 - Difficulty: Medium - Brief problem description: You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the... | 3.673626 | 4 |
palettes/theme.py | dirmeier/palettes | 1 | 6629639 | <filename>palettes/theme.py
import matplotlib as mpl
def set_theme():
"""
Set a custom theme
Theme removes axis spines right and top and adds a grid
"""
mpl.rcParams["axes.linewidth"] = 1.5
mpl.rcParams["axes.spines.right"] = False
mpl.rcParams["axes.spines.top"] = False
mpl.rcParams... | <filename>palettes/theme.py
import matplotlib as mpl
def set_theme():
"""
Set a custom theme
Theme removes axis spines right and top and adds a grid
"""
mpl.rcParams["axes.linewidth"] = 1.5
mpl.rcParams["axes.spines.right"] = False
mpl.rcParams["axes.spines.top"] = False
mpl.rcParams... | en | 0.540287 | Set a custom theme Theme removes axis spines right and top and adds a grid | 2.735384 | 3 |
src/DTW.py | Ishanh2000/CS698F | 2 | 6629640 | # AUM SHREEGANESHAAYA NAMAH|| AUM SHREEHANUMATE NAMAH|| AUM SHREEHANUMATE NAMAH||
import csv
def DTW(x = [], y = []):
""" Dynamic Time Warping on the two signals `x` and `y` """
M, N = len(x), len(y) # assume signals x and y have similar variance
if (M < 1) or (N < 1): return None # can do nothing
# Initiali... | # AUM SHREEGANESHAAYA NAMAH|| AUM SHREEHANUMATE NAMAH|| AUM SHREEHANUMATE NAMAH||
import csv
def DTW(x = [], y = []):
""" Dynamic Time Warping on the two signals `x` and `y` """
M, N = len(x), len(y) # assume signals x and y have similar variance
if (M < 1) or (N < 1): return None # can do nothing
# Initiali... | en | 0.737106 | # AUM SHREEGANESHAAYA NAMAH|| AUM SHREEHANUMATE NAMAH|| AUM SHREEHANUMATE NAMAH|| Dynamic Time Warping on the two signals `x` and `y` # assume signals x and y have similar variance # can do nothing # Initialization # [cost, parent] # [cost, parent] # Algorithm Assume `pPath` and `qPath` are valid absolute paths for now... | 2.850636 | 3 |
biobb_structure_utils/utils/extract_molecule.py | bioexcel/biobb_structure_utils | 1 | 6629641 | <reponame>bioexcel/biobb_structure_utils
#!/usr/bin/env python3
"""Module containing the ExtractMolecule class and the command line interface."""
import argparse
from biobb_common.configuration import settings
from biobb_common.tools import file_utils as fu
from biobb_common.tools.file_utils import launchlogger
from b... | #!/usr/bin/env python3
"""Module containing the ExtractMolecule class and the command line interface."""
import argparse
from biobb_common.configuration import settings
from biobb_common.tools import file_utils as fu
from biobb_common.tools.file_utils import launchlogger
from biobb_common.command_wrapper import cmd_wr... | en | 0.469493 | #!/usr/bin/env python3 Module containing the ExtractMolecule class and the command line interface. | biobb_structure_utils ExtractMolecule | This class is a wrapper of the Structure Checking tool to extract a molecule from a 3D structure. | Wrapper for the `Structure Checking <https://github.com/bioexcel/biobb_... | 2.694645 | 3 |
.github/scripts/check_all_icons.py | EnisMulic/devicon | 0 | 6629642 | <reponame>EnisMulic/devicon<gh_stars>0
from pathlib import Path
import json
# pycharm complains that build_assets is an unresolved ref
# don't worry about it, the script still runs
from build_assets import filehandler
if __name__ == "__main__":
"""
Use as a cmd line script to check all the icons of the devi... | from pathlib import Path
import json
# pycharm complains that build_assets is an unresolved ref
# don't worry about it, the script still runs
from build_assets import filehandler
if __name__ == "__main__":
"""
Use as a cmd line script to check all the icons of the devicon.json.
"""
devicon_json_path... | en | 0.936897 | # pycharm complains that build_assets is an unresolved ref # don't worry about it, the script still runs Use as a cmd line script to check all the icons of the devicon.json. | 2.582874 | 3 |
jupyter-notebooks/analysis-ready-data/visual.py | BradNeuberg/notebooks | 483 | 6629643 | import matplotlib.pyplot as plt
import matplotlib.colors as colors
import numpy as np
"""
The NDVI values will range from -1 to 1. You want to use a diverging color scheme to visualize the data,
and you want to center the colorbar at a defined midpoint. The class below allows you to normalize the colorbar.
"""
class M... | import matplotlib.pyplot as plt
import matplotlib.colors as colors
import numpy as np
"""
The NDVI values will range from -1 to 1. You want to use a diverging color scheme to visualize the data,
and you want to center the colorbar at a defined midpoint. The class below allows you to normalize the colorbar.
"""
class M... | en | 0.640895 | The NDVI values will range from -1 to 1. You want to use a diverging color scheme to visualize the data, and you want to center the colorbar at a defined midpoint. The class below allows you to normalize the colorbar. Normalise the colorbar so that diverging bars work there way either side from a prescribed midpoint va... | 3.42392 | 3 |
PBO_ 18130/latihan_42_list2.py | viraditty09/PBO | 0 | 6629644 | nilai_matakuliah=[70,80,90,90,13]
rata_rata= (sum(nilai_matakuliah)/len(nilai_matakuliah))
print("Nilai Matakuliah=", nilai_matakuliah)
print("Nilai rata_rata=", rata_rata)
| nilai_matakuliah=[70,80,90,90,13]
rata_rata= (sum(nilai_matakuliah)/len(nilai_matakuliah))
print("Nilai Matakuliah=", nilai_matakuliah)
print("Nilai rata_rata=", rata_rata)
| none | 1 | 3.126622 | 3 | |
bot/match/commands/swap_handler.py | monkeydg/POG-bot | 2 | 6629645 | from .command import InstantiatedCommand, Command, picking_states
from match.classes import CaptainValidator
from match.common import get_check_captain
from match import MatchStatus
from display import AllStrings as disp, ContextWrapper
import modules.roles as roles
from classes import Player
class SwapHandler(Inst... | from .command import InstantiatedCommand, Command, picking_states
from match.classes import CaptainValidator
from match.common import get_check_captain
from match import MatchStatus
from display import AllStrings as disp, ContextWrapper
import modules.roles as roles
from classes import Player
class SwapHandler(Inst... | en | 0.920323 | # Can't have a sub command running at the same time | 2.212224 | 2 |
src/waldur_core/core/utils.py | waldur/waldur-mastermind | 4 | 6629646 | import calendar
import datetime
import functools
import importlib
import os
import re
import time
import unicodedata
import uuid
import warnings
from collections import OrderedDict
from itertools import chain
from operator import itemgetter
import jwt
import requests
from django.apps import apps
from django.conf impor... | import calendar
import datetime
import functools
import importlib
import os
import re
import time
import unicodedata
import uuid
import warnings
from collections import OrderedDict
from itertools import chain
from operator import itemgetter
import jwt
import requests
from django.apps import apps
from django.conf impor... | en | 0.776835 | Return a OrderedDict ordered by key names from the :unsorted_dict: # sort items before inserting them into a dict Generate a random password with the given length. Allowed chars does not have "I" or "O" or letters and digits that look similar -- just to avoid confusion. Serialize Django model instance Deseriali... | 1.879041 | 2 |
train_resnet.py | BTajini/Resnet-Theano | 1 | 6629647 | #!/usr/bin/env python
from __future__ import print_function
import sys, os, time, string
import numpy as np
np.random.seed(1234)
import theano
import theano.tensor as T
import lasagne
from utils import *
sys.setrecursionlimit(10000)
print("Config mode " + theano.config.mode)
import argparse
parser = arg... | #!/usr/bin/env python
from __future__ import print_function
import sys, os, time, string
import numpy as np
np.random.seed(1234)
import theano
import theano.tensor as T
import lasagne
from utils import *
sys.setrecursionlimit(10000)
print("Config mode " + theano.config.mode)
import argparse
parser = arg... | en | 0.914821 | #!/usr/bin/env python # low initial learning rate as described in paper | 2.322146 | 2 |
src/apps/kms/backend/controllers/client/ClientsGetController.py | parada3desu/foxy-key-broker | 0 | 6629648 | from http import HTTPStatus
from fastapi.encoders import jsonable_encoder
from starlette.requests import Request
from starlette.responses import JSONResponse
from src.apps.kms.backend.controllers.KmsController import KmsController
from src.contexts.kms.clients.application.findall.FindClientsByCriteriaQuery import Fin... | from http import HTTPStatus
from fastapi.encoders import jsonable_encoder
from starlette.requests import Request
from starlette.responses import JSONResponse
from src.apps.kms.backend.controllers.KmsController import KmsController
from src.contexts.kms.clients.application.findall.FindClientsByCriteriaQuery import Fin... | none | 1 | 2.049393 | 2 | |
nebulousAD/modimpacket/pcapfile.py | BraveLittleRoaster/nebulousAD | 130 | 6629649 | # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved.
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
from nebulousAD.modimpacket import ImpactPacket, ImpactDecoder, structure
O... | # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved.
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
from nebulousAD.modimpacket import ImpactPacket, ImpactDecoder, structure
O... | en | 0.820879 | # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # | 1.861159 | 2 |
tests/test_cudata.py | bryancatanzaro/copperhead | 98 | 6629650 | #
# Copyright 2012 NVIDIA 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 ... | #
# Copyright 2012 NVIDIA 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 ... | en | 0.842436 | # # Copyright 2012 NVIDIA 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... | 2.254641 | 2 |