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 |
|---|---|---|---|---|---|---|---|---|---|---|
test2/test2.py | kubatom/my_nemtiko_repo | 0 | 7100 | print('this is a test2 file')
| print('this is a test2 file')
| none | 1 | 0.973889 | 1 | |
Source/Git/Experiments/git_annotate.py | cadappl/scm-workbench | 24 | 7101 | <reponame>cadappl/scm-workbench
#!/usr/bin/python3
import sys
import git
r = git.Repo( sys.argv[1] )
num = 0
for info in r.blame( 'HEAD', sys.argv[2] ):
num += 1
commit = info[0]
all_lines = info[1]
print( '%s %6d:%s' % (commit, num, all_lines[0]) )
for line in all_lines[1:]:
num += 1
... | #!/usr/bin/python3
import sys
import git
r = git.Repo( sys.argv[1] )
num = 0
for info in r.blame( 'HEAD', sys.argv[2] ):
num += 1
commit = info[0]
all_lines = info[1]
print( '%s %6d:%s' % (commit, num, all_lines[0]) )
for line in all_lines[1:]:
num += 1
print( '%*s %6d:%s' % (4... | fr | 0.386793 | #!/usr/bin/python3 | 2.785708 | 3 |
configs/global_configs.py | HansikaPH/time-series-forecasting | 67 | 7102 | <gh_stars>10-100
# configs for the model training
class model_training_configs:
VALIDATION_ERRORS_DIRECTORY = 'results/validation_errors/'
INFO_FREQ = 1
# configs for the model testing
class model_testing_configs:
RNN_FORECASTS_DIRECTORY = 'results/rnn_forecasts/'
RNN_ERRORS_DIRECTORY = 'results/errors... | # configs for the model training
class model_training_configs:
VALIDATION_ERRORS_DIRECTORY = 'results/validation_errors/'
INFO_FREQ = 1
# configs for the model testing
class model_testing_configs:
RNN_FORECASTS_DIRECTORY = 'results/rnn_forecasts/'
RNN_ERRORS_DIRECTORY = 'results/errors'
PROCESSED_R... | en | 0.691287 | # configs for the model training # configs for the model testing # configs for hyperparameter tuning(SMAC3) | 1.420378 | 1 |
openprocurement/blade/tests/auctions.py | imaginal/openprocurement.blade | 0 | 7103 | # -*- coding: utf-8 -*-
import unittest
from uuid import uuid4
from copy import deepcopy
from openprocurement.api.models import get_now
from openprocurement.edge.tests.base import AuctionBaseWebTest, test_award, test_auction_data, test_document, ROUTE_PREFIX
try:
import openprocurement.auctions.core as auctions_co... | # -*- coding: utf-8 -*-
import unittest
from uuid import uuid4
from copy import deepcopy
from openprocurement.api.models import get_now
from openprocurement.edge.tests.base import AuctionBaseWebTest, test_award, test_auction_data, test_document, ROUTE_PREFIX
try:
import openprocurement.auctions.core as auctions_co... | en | 0.768738 | # -*- coding: utf-8 -*- # put custom document object into database to check auction construction on non-Auction data | 2.324913 | 2 |
webium/controls/select.py | kejkz/webium | 152 | 7104 | from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.remote.webelement import WebElement
class Select(WebElement):
"""
Implements logic to work with Web List UI elements
"""
@property
def is_multiple(self):
value = self.get_attribute('multiple')
re... | from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.remote.webelement import WebElement
class Select(WebElement):
"""
Implements logic to work with Web List UI elements
"""
@property
def is_multiple(self):
value = self.get_attribute('multiple')
re... | en | 0.774539 | Implements logic to work with Web List UI elements Performs selection of provided item from Web List @params option - string item name Performs search for provided item in Web List Performs search of selected item from Web List Return attribute of selected item @params attribute - string attri... | 3.189758 | 3 |
mc/cookies/CookieManager.py | zy-sunshine/falkon-pyqt5 | 1 | 7105 | <filename>mc/cookies/CookieManager.py
from PyQt5.QtWidgets import QDialog
from PyQt5 import uic
from PyQt5.Qt import Qt
from PyQt5.Qt import QShortcut
from PyQt5.Qt import QKeySequence
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtWidgets import QInputDialog
from PyQt5.Qt import QDateTime
from PyQt5.Qt import QS... | <filename>mc/cookies/CookieManager.py
from PyQt5.QtWidgets import QDialog
from PyQt5 import uic
from PyQt5.Qt import Qt
from PyQt5.Qt import QShortcut
from PyQt5.Qt import QKeySequence
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtWidgets import QInputDialog
from PyQt5.Qt import QDateTime
from PyQt5.Qt import QS... | en | 0.194901 | @param parent QWidget # QHash<QString, QTreeWidgetItem> # QHash<QTreeWidgetItem, QNetworkCookie> # Stored Cookies # Cookie Filtering # Cookie Settings # Load cookies # private Q_SLOTS: @param: current QTreeWidgetItem @param: parent QTreeWidgetItem # QList<QNetworkCookie> # QTreeWidgetItem @param: string QString... | 2.162974 | 2 |
.circleci/process_submitted_data.py | dongbohu/cimr-d | 0 | 7106 | #!/usr/bin/env python3
import os
import sys
import logging
import subprocess
logging.basicConfig(level=logging.INFO)
root_dir = 'submitted_data'
submitted_file_split = set()
for dir_, _, files in os.walk(root_dir):
for file_name in files:
rel_dir = os.path.relpath(dir_, root_dir)
rel_file = os... | #!/usr/bin/env python3
import os
import sys
import logging
import subprocess
logging.basicConfig(level=logging.INFO)
root_dir = 'submitted_data'
submitted_file_split = set()
for dir_, _, files in os.walk(root_dir):
for file_name in files:
rel_dir = os.path.relpath(dir_, root_dir)
rel_file = os... | fr | 0.221828 | #!/usr/bin/env python3 | 2.171191 | 2 |
common/enums.py | resourceidea/resourceideaapi | 1 | 7107 | import enum
class Status(enum.Enum):
"""Status enumeration."""
ACTIVE = 'ACTIVE'
DISABLED = 'DISABLED'
ARCHIVED = 'ARCHIVED'
DELETED = 'DELETED'
class ProgressStatus(enum.Enum):
"""Enumeration indicates the different
stages of the progress made on an engagement,
job or ... | import enum
class Status(enum.Enum):
"""Status enumeration."""
ACTIVE = 'ACTIVE'
DISABLED = 'DISABLED'
ARCHIVED = 'ARCHIVED'
DELETED = 'DELETED'
class ProgressStatus(enum.Enum):
"""Enumeration indicates the different
stages of the progress made on an engagement,
job or ... | en | 0.795117 | Status enumeration. Enumeration indicates the different
stages of the progress made on an engagement,
job or task. | 3.080638 | 3 |
networks/mobilenet.py | softsys4ai/FlexiBO | 8 | 7108 | # 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.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # 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.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | en | 0.718969 | # 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. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ... | 2.461772 | 2 |
info.py | altfool/mri_face_detection | 1 | 7109 | import numpy as np
img_dtype = np.float32
imgX, imgY, imgZ = (256, 256, 150)
imgs_path_withfaces = '../dataset/withfaces'
imgs_path_nofaces = '../dataset/nofaces'
imgX_dwt1, imgY_dwt1, imgZ_dwt1 = (128, 128, 75)
imgs_path_withfaces_dwt = './dataset/withfaces'
imgs_path_nofaces_dwt = './dataset/nofaces'
dwt_flag = (... | import numpy as np
img_dtype = np.float32
imgX, imgY, imgZ = (256, 256, 150)
imgs_path_withfaces = '../dataset/withfaces'
imgs_path_nofaces = '../dataset/nofaces'
imgX_dwt1, imgY_dwt1, imgZ_dwt1 = (128, 128, 75)
imgs_path_withfaces_dwt = './dataset/withfaces'
imgs_path_nofaces_dwt = './dataset/nofaces'
dwt_flag = (... | none | 1 | 2.009739 | 2 | |
biggan/paddorch/paddorch/vision/functional.py | zzz2010/Contrib | 20 | 7110 | <filename>biggan/paddorch/paddorch/vision/functional.py<gh_stars>10-100
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | <filename>biggan/paddorch/paddorch/vision/functional.py<gh_stars>10-100
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | en | 0.681759 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 2.875385 | 3 |
ground_battle.py | ashhansen6/minigames | 0 | 7111 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 13:38:35 2021
GROUND INVASION! The Game
@author: <NAME> (<EMAIL>)
"""
# Packages used:
import numpy as np
import pandas as pd
import random as rng
from termcolor import colored
# Defining starting forces
## Defenders:
def_force = 1250
def_reserves = ... | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 13:38:35 2021
GROUND INVASION! The Game
@author: <NAME> (<EMAIL>)
"""
# Packages used:
import numpy as np
import pandas as pd
import random as rng
from termcolor import colored
# Defining starting forces
## Defenders:
def_force = 1250
def_reserves = ... | en | 0.221741 | # -*- coding: utf-8 -*- Created on Fri Jan 29 13:38:35 2021
GROUND INVASION! The Game
@author: <NAME> (<EMAIL>) # Packages used: # Defining starting forces ## Defenders: ## Attackers: # Defining strategies: ## Defenders: ### Draft # Defender Strategy Information ######### INTELLIGENCE REPORT ##########", on_color =... | 3.380316 | 3 |
src/pretalx/orga/urls.py | martinheidegger/pretalx | 0 | 7112 | <filename>src/pretalx/orga/urls.py
from django.conf.urls import include, url
from django.views.generic.base import RedirectView
from pretalx.event.models.event import SLUG_CHARS
from pretalx.orga.views import cards
from .views import (
admin,
auth,
cfp,
dashboard,
event,
mails,
organiser,
... | <filename>src/pretalx/orga/urls.py
from django.conf.urls import include, url
from django.views.generic.base import RedirectView
from pretalx.event.models.event import SLUG_CHARS
from pretalx.orga.views import cards
from .views import (
admin,
auth,
cfp,
dashboard,
event,
mails,
organiser,
... | none | 1 | 1.841924 | 2 | |
ws2122-lspm/Lib/site-packages/pm4py/statistics/overlap/utils/compute.py | Malekhy/ws2122-lspm | 1 | 7113 | <reponame>Malekhy/ws2122-lspm
'''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or... | '''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... | en | 0.873339 | This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de). PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later versio... | 2.918002 | 3 |
webapp/apps/Base Quiz/baseui_gen.py | sk-Prime/webapp | 4 | 7114 | <filename>webapp/apps/Base Quiz/baseui_gen.py
from htmlman import HTMLMan
from styleman import Template
page=HTMLMan()
page.make_responsive()
page.add_title("Base Quiz")
style=Template('antartica')
page.add_body_class(style['page'])
page.add_js("baseui.js")
page.create_section('main',append=True)
page['main'].add_sty... | <filename>webapp/apps/Base Quiz/baseui_gen.py
from htmlman import HTMLMan
from styleman import Template
page=HTMLMan()
page.make_responsive()
page.add_title("Base Quiz")
style=Template('antartica')
page.add_body_class(style['page'])
page.add_js("baseui.js")
page.create_section('main',append=True)
page['main'].add_sty... | ko | 0.115734 | #label.add_style_class(style['center']) #ccd", | 2.596199 | 3 |
cluster_config/cluster.py | srcc-msu/job_statistics | 0 | 7115 | <gh_stars>0
name = "cluster"
num_cores = 1000
GENERAL_PARTITIONS = ["regular"]
GPU_PARTITIONS = ["gpu"]
PARTITIONS = GENERAL_PARTITIONS + GPU_PARTITIONS
ACTIVE_JOB_STATES = ["RUNNING", "COMPLETING"]
FINISHED_JOB_STATES = ["COMPLETED", "NODE_FAIL", "TIMEOUT", "FAILED", "CANCELLED"]
JOB_STATES = ACTIVE_JOB_STATES + F... | name = "cluster"
num_cores = 1000
GENERAL_PARTITIONS = ["regular"]
GPU_PARTITIONS = ["gpu"]
PARTITIONS = GENERAL_PARTITIONS + GPU_PARTITIONS
ACTIVE_JOB_STATES = ["RUNNING", "COMPLETING"]
FINISHED_JOB_STATES = ["COMPLETED", "NODE_FAIL", "TIMEOUT", "FAILED", "CANCELLED"]
JOB_STATES = ACTIVE_JOB_STATES + FINISHED_JOB_... | en | 0.61457 | custom function to convert nodename to int this one removes all chars from names like node1-001-01 | 2.78261 | 3 |
room_assistance/indico_room_assistance/plugin.py | OmeGak/indico-plugins-cern | 4 | 7116 | # This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2021 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
import dateutil.parser
import pytz
from flask import flash, request... | # This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2021 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
import dateutil.parser
import pytz
from flask import flash, request... | en | 0.84773 | # This file is part of the CERN Indico plugins. # Copyright (C) 2014 - 2021 CERN # # The CERN Indico plugins are free software; you can redistribute # them and/or modify them under the terms of the MIT License; see # the LICENSE file for more details. Room assistance request This plugin lets users request assistan... | 1.716206 | 2 |
datamart/materializers/wikidata_spo_materializer.py | liangmuxin/datamart | 7 | 7117 | <gh_stars>1-10
from datamart.materializers.materializer_base import MaterializerBase
import os
import urllib.request
import sys
import csv
import copy
import json
from typing import List
from pprint import pprint
import re
import typing
from pandas import DataFrame
import traceback
class WikidataSPOMaterializer(Mate... | from datamart.materializers.materializer_base import MaterializerBase
import os
import urllib.request
import sys
import csv
import copy
import json
from typing import List
from pprint import pprint
import re
import typing
from pandas import DataFrame
import traceback
class WikidataSPOMaterializer(MaterializerBase):
... | en | 0.268864 | initialization and loading the city name to city id map # print(prefix + main_query_encoded + format) # property_label = re.sub(r"\s+", '_', property_label) # print("property ", property, "count ", count) # for val in values: # col_name = col_name.union(set(val.keys())) # columns = list(col_name) # print(k1, v1) # prin... | 2.506478 | 3 |
axelrod/load_data_.py | danilobellini/Axelrod | 0 | 7118 | <filename>axelrod/load_data_.py
from typing import Dict, List, Tuple
import pkg_resources
def load_file(filename: str, directory: str) -> List[List[str]]:
"""Loads a data file stored in the Axelrod library's data subdirectory,
likely for parameters for a strategy."""
path = "/".join((directory, filename)... | <filename>axelrod/load_data_.py
from typing import Dict, List, Tuple
import pkg_resources
def load_file(filename: str, directory: str) -> List[List[str]]:
"""Loads a data file stored in the Axelrod library's data subdirectory,
likely for parameters for a strategy."""
path = "/".join((directory, filename)... | en | 0.70729 | Loads a data file stored in the Axelrod library's data subdirectory, likely for parameters for a strategy. Load Neural Network Weights. Load lookup tables. | 3.087334 | 3 |
prescryptchain/api/views.py | genobank-io/CryptoVault | 3 | 7119 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# REST
from rest_framework.viewsets import ViewSetMixin
from rest_framework import routers, serializers, viewsets
from rest_framework.authentication import SessionAuthentication, BasicAuthentication, TokenAuthentication
from rest_framework.permissions imp... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# REST
from rest_framework.viewsets import ViewSetMixin
from rest_framework import routers, serializers, viewsets
from rest_framework.authentication import SessionAuthentication, BasicAuthentication, TokenAuthentication
from rest_framework.permissions imp... | en | 0.823265 | # -*- coding: utf-8 -*- # REST # our models # Define router Prescription serializer Method to control Extra Keys on Payload! Prescription Viewset # Temporally without auth # authentication_classes = (TokenAuthentication, BasicAuthentication, ) # permission_classes = (IsAuthenticated, ) Custom Get queryset # add patient... | 1.991538 | 2 |
client/commands/incremental.py | stvreumi/pyre-check | 0 | 7120 | <reponame>stvreumi/pyre-check
# Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import atexit
import logging
import os
import subprocess
import sys
from typing import List
from .command import Clie... | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import atexit
import logging
import os
import subprocess
import sys
from typing import List
from .command import ClientException, ExitCode, State
f... | en | 0.864235 | # Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-ignore: T31696900 | 2.161089 | 2 |
main_random_policy.py | rish-raghu/Object-Goal-Navigation | 0 | 7121 | from collections import deque, defaultdict
import os
import sys
import logging
import time
import json
import gym
import torch.nn as nn
import torch
import numpy as np
import matplotlib.pyplot as plt
from model import RL_Policy, Semantic_Mapping
from utils.storage import GlobalRolloutStorage
from envs import make_vec_... | from collections import deque, defaultdict
import os
import sys
import logging
import time
import json
import gym
import torch.nn as nn
import torch
import numpy as np
import matplotlib.pyplot as plt
from model import RL_Policy, Semantic_Mapping
from utils.storage import GlobalRolloutStorage
from envs import make_vec_... | en | 0.666702 | # Setup Logging # Logging and loss variables # one episode per process for both train and eval # for eval, one scene per process # for train, different episodes of same scene per process # Starting environments # Initialize map variables: # Full map consists of multiple channels containing the following: # 1. Obstacle ... | 2.023462 | 2 |
src/ITN/srmg/core/RiemannianRight.py | Yulv-git/Awesome-Ultrasound-Standard-Plane-Detection | 1 | 7122 | <filename>src/ITN/srmg/core/RiemannianRight.py
#!/usr/bin/env python
# coding=utf-8
'''
Author: <NAME> / Yulv
Email: <EMAIL>
Date: 2022-03-19 10:33:38
Motto: Entities should not be multiplied unnecessarily.
LastEditors: <NAME>
LastEditTime: 2022-03-23 00:52:55
FilePath: /Awesome-Ultrasound-Standard-Plane-Detection/src/... | <filename>src/ITN/srmg/core/RiemannianRight.py
#!/usr/bin/env python
# coding=utf-8
'''
Author: <NAME> / Yulv
Email: <EMAIL>
Date: 2022-03-19 10:33:38
Motto: Entities should not be multiplied unnecessarily.
LastEditors: <NAME>
LastEditTime: 2022-03-23 00:52:55
FilePath: /Awesome-Ultrasound-Standard-Plane-Detection/src/... | en | 0.634731 | #!/usr/bin/env python # coding=utf-8 Author: <NAME> / Yulv Email: <EMAIL> Date: 2022-03-19 10:33:38 Motto: Entities should not be multiplied unnecessarily. LastEditors: <NAME> LastEditTime: 2022-03-23 00:52:55 FilePath: /Awesome-Ultrasound-Standard-Plane-Detection/src/ITN/srmg/core/RiemannianRight.py Description: Modif... | 1.194958 | 1 |
v0449gRpc_pb2.py | StormDev87/VPH_bot_python | 1 | 7123 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v0449gRpc.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from go... | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v0449gRpc.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from go... | en | 0.411184 | # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: v0449gRpc.proto Generated protocol buffer code. # @@protoc_insertion_point(imports) # @@protoc_insertion_point(class_scope:v0449gRpc.dataRequest) # @@protoc_insertion_point(class_scope:v0449gRpc.data2Plc) # @@protoc_insertion_p... | 1.135045 | 1 |
api/resources_portal/test/views/test_search_endpoint.py | AlexsLemonade/resources-portal | 0 | 7124 | import datetime
from django.core.management import call_command
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from resources_portal.management.commands.populate_dev_database import populate_dev_database
from resources_portal.models import Material, Organ... | import datetime
from django.core.management import call_command
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from resources_portal.management.commands.populate_dev_database import populate_dev_database
from resources_portal.models import Material, Organ... | en | 0.848525 | Tests /search/materials operations. # Put newly created materials in the search index # Rebuild search index with what's actaully in the django database # Archive one material to make sure it goes to the bottom of the list. # Make sure archived materials are last: # Search with one organism name # Search with one organ... | 2.181776 | 2 |
mindarmour/utils/logger.py | hboshnak/mindarmour | 139 | 7125 | # Copyright 2019 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... | # Copyright 2019 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.607943 | # Copyright 2019 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.16799 | 2 |
Python/Programming Basics/Simple Calculations/17. Daily Earnings.py | teodoramilcheva/softuni-software-engineering | 0 | 7126 | workdays = float(input())
daily_tips = float(input())
exchange_rate = float(input())
salary = workdays * daily_tips
annual_income = salary * 12 + salary * 2.5
net_income = annual_income - annual_income * 25 / 100
result = net_income / 365 * exchange_rate
print('%.2f' % result)
| workdays = float(input())
daily_tips = float(input())
exchange_rate = float(input())
salary = workdays * daily_tips
annual_income = salary * 12 + salary * 2.5
net_income = annual_income - annual_income * 25 / 100
result = net_income / 365 * exchange_rate
print('%.2f' % result)
| none | 1 | 3.658466 | 4 | |
bert_rerannker_eval.py | satya77/transformer_rankers | 0 | 7127 | <gh_stars>0
from transformer_rankers.trainers import transformer_trainer
from transformer_rankers.datasets import dataset, preprocess_scisumm_ranked
from transformer_rankers.eval import results_analyses_tools
from transformers import BertTokenizer, BertForSequenceClassification
from sacred.observers import FileStorage... | from transformer_rankers.trainers import transformer_trainer
from transformer_rankers.datasets import dataset, preprocess_scisumm_ranked
from transformer_rankers.eval import results_analyses_tools
from transformers import BertTokenizer, BertForSequenceClassification
from sacred.observers import FileStorageObserver
fro... | en | 0.355529 | # Choose the negative candidate sampler # Create the loaders for the datasets, with the respective negative samplers # Instantiate transformer model to be used # Instantiate trainer that handles fitting. # Predict for test # res = results_analyses_tools.evaluate_and_aggregate(preds, labels, ['R_10@1', # ... | 2.102717 | 2 |
python/p21.py | tonyfg/project_euler | 0 | 7128 | <gh_stars>0
#Q: Evaluate the sum of all the amicable numbers under 10000.
#A: 31626
def divisor_sum(n):
return sum([i for i in xrange (1, n//2+1) if not n%i])
def sum_amicable(start, end):
sum = 0
for i in xrange(start, end):
tmp = divisor_sum(i)
if i == divisor_sum(tmp) and i != tmp:
... | #Q: Evaluate the sum of all the amicable numbers under 10000.
#A: 31626
def divisor_sum(n):
return sum([i for i in xrange (1, n//2+1) if not n%i])
def sum_amicable(start, end):
sum = 0
for i in xrange(start, end):
tmp = divisor_sum(i)
if i == divisor_sum(tmp) and i != tmp:
... | en | 0.822 | #Q: Evaluate the sum of all the amicable numbers under 10000. #A: 31626 #each pair is found twice, so divide by 2 ;) | 3.543166 | 4 |
check.py | Dysoncat/student-services-slas-chat-bot | 0 | 7129 | <filename>check.py
import long_responses as long
# Returns the probability of a message matching the responses that we have
def messageProb(userMessage, recognizedWords, isSingleResponse=False, requiredWords=[]):
messageCertainty = 0
hasRequiredWords = True
# Counts how many words are present in each pr... | <filename>check.py
import long_responses as long
# Returns the probability of a message matching the responses that we have
def messageProb(userMessage, recognizedWords, isSingleResponse=False, requiredWords=[]):
messageCertainty = 0
hasRequiredWords = True
# Counts how many words are present in each pr... | en | 0.760388 | # Returns the probability of a message matching the responses that we have # Counts how many words are present in each predefined message # Calculates the percent of recognized words in a user message # Checks that the required words are in the string # Must either have the required words, or be a single response # Che... | 3.044048 | 3 |
image_predictor/utils.py | jdalzatec/streamlit-manizales-tech-talks | 2 | 7130 | <reponame>jdalzatec/streamlit-manizales-tech-talks<filename>image_predictor/utils.py<gh_stars>1-10
from io import StringIO
import numpy as np
from h5py import File
from keras.models import load_model as keras_load_model
from PIL import Image, ImageOps
def predict(image, model):
# Create the array of the right sh... | from io import StringIO
import numpy as np
from h5py import File
from keras.models import load_model as keras_load_model
from PIL import Image, ImageOps
def predict(image, model):
# Create the array of the right shape to feed into the keras model
# The 'length' or number of images you can put into the array ... | en | 0.900765 | # Create the array of the right shape to feed into the keras model # The 'length' or number of images you can put into the array is # determined by the first position in the shape tuple, in this case 1. # Replace this with the path to your image # resize the image to a 224x224 with the same strategy as in TM2: # resizi... | 3.101586 | 3 |
client/setup.py | emilywoods/docker-workshop | 1 | 7131 | <filename>client/setup.py<gh_stars>1-10
from setuptools import setup
setup(
name="workshop-client",
install_requires=["flask==1.1.1", "requests==2.22.0"],
python_requires=">=3.7",
classifiers=[
"Development Status :: 1 - Beta",
"License :: OSI Approved :: MIT License",
"Programm... | <filename>client/setup.py<gh_stars>1-10
from setuptools import setup
setup(
name="workshop-client",
install_requires=["flask==1.1.1", "requests==2.22.0"],
python_requires=">=3.7",
classifiers=[
"Development Status :: 1 - Beta",
"License :: OSI Approved :: MIT License",
"Programm... | none | 1 | 1.385193 | 1 | |
tests/facebook/models/test_photo.py | Socian-Ltd/python-facebook-1 | 2 | 7132 | <filename>tests/facebook/models/test_photo.py
import json
import unittest
import pyfacebook.models as models
class PhotoModelTest(unittest.TestCase):
BASE_PATH = "testdata/facebook/models/photos/"
with open(BASE_PATH + 'photo.json', 'rb') as f:
PHOTO_INFO = json.loads(f.read().decode('utf-8'))
... | <filename>tests/facebook/models/test_photo.py
import json
import unittest
import pyfacebook.models as models
class PhotoModelTest(unittest.TestCase):
BASE_PATH = "testdata/facebook/models/photos/"
with open(BASE_PATH + 'photo.json', 'rb') as f:
PHOTO_INFO = json.loads(f.read().decode('utf-8'))
... | none | 1 | 2.856153 | 3 | |
airbyte-integrations/connectors/source-scaffold-source-python/source_scaffold_source_python/source.py | curanaj/airbyte-dbt-demo | 0 | 7133 | # MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | # MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | en | 0.801923 | # MIT License # # Copyright (c) 2020 Airbyte # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ... | 1.632031 | 2 |
alerter/src/monitorables/nodes/chainlink_node.py | SimplyVC/panic | 41 | 7134 | from datetime import datetime
from typing import Optional, Dict, List, Union
from schema import Schema, Or
from src.monitorables.nodes.node import Node
from src.utils.exceptions import InvalidDictSchemaException
class ChainlinkNode(Node):
def __init__(self, node_name: str, node_id: str, parent_id: str) -> None:... | from datetime import datetime
from typing import Optional, Dict, List, Union
from schema import Schema, Or
from src.monitorables.nodes.node import Node
from src.utils.exceptions import InvalidDictSchemaException
class ChainlinkNode(Node):
def __init__(self, node_name: str, node_id: str, parent_id: str) -> None:... | en | 0.797586 | # Metrics # This variable stores the url of the source used to get prometheus node # data. Note that this had to be done because multiple prometheus # sources can be associated with the same node, where at the same time # only one source is available, and sources switch from time to time. # This stores the timestamp of... | 2.420694 | 2 |
experiments/vgg16/VGG16_utils.py | petrapoklukar/DCA | 2 | 7135 | import pickle
import numpy as np
import os
def _analyze_query_point_assignment(
query_data_dict: dict,
init_Rdata_dict: dict,
init_Edata_dict: dict,
num_R: int,
query_point_assignment_array: np.ndarray,
root: str,
n_points_to_copy=50,
):
"""
Analyzes and visualizes qDCA results.
... | import pickle
import numpy as np
import os
def _analyze_query_point_assignment(
query_data_dict: dict,
init_Rdata_dict: dict,
init_Edata_dict: dict,
num_R: int,
query_point_assignment_array: np.ndarray,
root: str,
n_points_to_copy=50,
):
"""
Analyzes and visualizes qDCA results.
... | en | 0.72785 | Analyzes and visualizes qDCA results. :param query_data_dict: raw query data. :param init_Rdata_dict: raw R data. :param init_Edata_dict: raw E data. :param num_R: total number of R points. :param query_point_assignment_array: query point assignments results. :param root: root directory of the e... | 2.614575 | 3 |
back-end/RawFishSheep/app_cart/views.py | Coldarra/RawFishSheep | 0 | 7136 | <reponame>Coldarra/RawFishSheep
from .models import *
from decorator import *
from app_goods.views import getGoodsByID
# 查询当前用户所有的购物车信息
def getCartByUser(user_id=None):
if user_id == None:
raise ParamException()
return Cart.objects.filter(user_id=user_id)
def getSelectedCart(user_id=None):
if ... | from .models import *
from decorator import *
from app_goods.views import getGoodsByID
# 查询当前用户所有的购物车信息
def getCartByUser(user_id=None):
if user_id == None:
raise ParamException()
return Cart.objects.filter(user_id=user_id)
def getSelectedCart(user_id=None):
if user_id == None:
raise P... | zh | 0.983885 | # 查询当前用户所有的购物车信息 # 检测参数是否合法 # 检测商品状态是否合法 # 改变商品状态 | 2.284822 | 2 |
extensions/catsum.py | johannesgiorgis/my-timewarrior-extensions | 0 | 7137 | #!/usr/bin/env python3
###############################################################################
#
# Category Summaries
#
#
###############################################################################
import datetime
import io
import json
import logging
import pprint
import sys
from typing import Dict, Any
... | #!/usr/bin/env python3
###############################################################################
#
# Category Summaries
#
#
###############################################################################
import datetime
import io
import json
import logging
import pprint
import sys
from typing import Dict, Any
... | en | 0.386333 | #!/usr/bin/env python3 ############################################################################### # # Category Summaries # # ############################################################################### # set logging # create handler # Create formatters and add it to handlers # Add handlers to the logger # TODO:... | 2.410477 | 2 |
resources/hotel.py | jnascimentocode/REST-API-COM-PYTHON-E-FLASK | 0 | 7138 | from typing import ParamSpecArgs
from flask_restful import Resource, reqparse
from models.hotel import HotelModel
from flask_jwt_extended import jwt_required
from models.site import SiteModel
from resources.filtros import *
import sqlite3
path_params = reqparse.RequestParser()
path_params.add_argument('cidade', type=s... | from typing import ParamSpecArgs
from flask_restful import Resource, reqparse
from models.hotel import HotelModel
from flask_jwt_extended import jwt_required
from models.site import SiteModel
from resources.filtros import *
import sqlite3
path_params = reqparse.RequestParser()
path_params.add_argument('cidade', type=s... | none | 1 | 2.47997 | 2 | |
src/wormhole/__main__.py | dmgolembiowski/magic-wormhole | 2,801 | 7139 | from __future__ import absolute_import, print_function, unicode_literals
if __name__ == "__main__":
from .cli import cli
cli.wormhole()
else:
# raise ImportError('this module should not be imported')
pass
| from __future__ import absolute_import, print_function, unicode_literals
if __name__ == "__main__":
from .cli import cli
cli.wormhole()
else:
# raise ImportError('this module should not be imported')
pass
| en | 0.107521 | # raise ImportError('this module should not be imported') | 1.593724 | 2 |
testing/berge_equilibrium_cndp.py | Eliezer-Beczi/CNDP | 1 | 7140 | <reponame>Eliezer-Beczi/CNDP<filename>testing/berge_equilibrium_cndp.py
import networkx as nx
import utils.connectivity_metrics as connectivity_metric
from platypus import NSGAII, EpsMOEA, NSGAIII, EpsNSGAII, Problem, Dominance, Subset, TournamentSelector, \
HypervolumeFitnessEvaluator, Archive
import statistics
im... | import networkx as nx
import utils.connectivity_metrics as connectivity_metric
from platypus import NSGAII, EpsMOEA, NSGAIII, EpsNSGAII, Problem, Dominance, Subset, TournamentSelector, \
HypervolumeFitnessEvaluator, Archive
import statistics
import multiprocessing as mp
G = nx.read_adjlist("input/Ventresca/Barabas... | none | 1 | 2.663295 | 3 | |
policykit/django_db_logger/migrations/0002_initial.py | mashton/policyk | 78 | 7141 | # Generated by Django 3.2.2 on 2021-09-02 15:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('django_db_logger', '0001_initial'),
('policyengine', '0001_initial'),
]
operations = [
... | # Generated by Django 3.2.2 on 2021-09-02 15:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('django_db_logger', '0001_initial'),
('policyengine', '0001_initial'),
]
operations = [
... | en | 0.817558 | # Generated by Django 3.2.2 on 2021-09-02 15:10 | 1.532142 | 2 |
Charm/models/risk_functions.py | TanyaAdams1/Charm | 17 | 7142 | <filename>Charm/models/risk_functions.py
import numpy as np
from mcerp import *
from uncertainties.core import AffineScalarFunc
class RiskFunction(object):
def get_risk(self, bar, p):
""" Computes risk for perf array w.r.t. bar.
Args:
bar: reference performance bar.
perfs: ... | <filename>Charm/models/risk_functions.py
import numpy as np
from mcerp import *
from uncertainties.core import AffineScalarFunc
class RiskFunction(object):
def get_risk(self, bar, p):
""" Computes risk for perf array w.r.t. bar.
Args:
bar: reference performance bar.
perfs: ... | en | 0.644686 | Computes risk for perf array w.r.t. bar. Args: bar: reference performance bar. perfs: performance array-like. Returns: single float (mean risk) #TODO: what should we return? How to define risk analytically? # risk = a * (perf-bar) # risk = a * (perf-bar)**2 + b * (p... | 2.512571 | 3 |
code/doubanUtils.py | verazuo/douban_crawler | 1 | 7143 | <gh_stars>1-10
import requests
import re
from bs4 import BeautifulSoup
def nextPageLink(sess,soup,page,head=""):
NextPage=soup.find(class_='next').link.get('href')
req=sess.get(head + NextPage)
print(f'第{page}页:',req.status_code)
return BeautifulSoup(req.text,'html.parser') | import requests
import re
from bs4 import BeautifulSoup
def nextPageLink(sess,soup,page,head=""):
NextPage=soup.find(class_='next').link.get('href')
req=sess.get(head + NextPage)
print(f'第{page}页:',req.status_code)
return BeautifulSoup(req.text,'html.parser') | none | 1 | 2.851707 | 3 | |
491/491.py | kaixiang1992/python-flask | 0 | 7144 | from sqlalchemy import create_engine, Column, Integer, String, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# TODO: db_uri
# dialect+driver://username:password@host:port/database?charset=utf8
DB_URI = 'mysql+pymysql://root:root123@127.0.0.1:33... | from sqlalchemy import create_engine, Column, Integer, String, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# TODO: db_uri
# dialect+driver://username:password@host:port/database?charset=utf8
DB_URI = 'mysql+pymysql://root:root123@127.0.0.1:33... | zh | 0.211895 | # TODO: db_uri # dialect+driver://username:password@host:port/database?charset=utf8 # TODO: 定义User模型 # TODO: 创建Article模型 # TODO: 外键约束 # TODO: 删除数据库 # Base.metadata.drop_all() # TODO: 创建数据库 # Base.metadata.create_all() # # user = User(name='zhiliao') # article1 = Article(title='python') # article2 = Article(title='flask... | 2.972312 | 3 |
spacy/tests/tagger/test_lemmatizer.py | TerminalWitchcraft/spaCy | 1 | 7145 | # coding: utf-8
from __future__ import unicode_literals
from ...lemmatizer import read_index, read_exc
import pytest
@pytest.mark.models
@pytest.mark.parametrize('text,lemmas', [("aardwolves", ["aardwolf"]),
("aardwolf", ["aardwolf"]),
... | # coding: utf-8
from __future__ import unicode_literals
from ...lemmatizer import read_index, read_exc
import pytest
@pytest.mark.models
@pytest.mark.parametrize('text,lemmas', [("aardwolves", ["aardwolf"]),
("aardwolf", ["aardwolf"]),
... | en | 0.833554 | # coding: utf-8 | 2.422751 | 2 |
sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py | RAY-316/azure-sdk-for-python | 0 | 7146 | # 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 may ... | # 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 may ... | en | 0.480727 | # 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 may ... | 1.457924 | 1 |
AlgoNet2/Helper.py | Bhaney44/AlgorandDevelopment | 0 | 7147 | import numpy as np
from keras.models import Sequential
from keras.layers import LSTM, Dense, Dropout
def visualize_training_results(results):
"""
Plots the loss and accuracy for the training and testing data
"""
history = results.history
plt.figure(figsize=(12,4))
plt.plot(history['val_loss'])
... | import numpy as np
from keras.models import Sequential
from keras.layers import LSTM, Dense, Dropout
def visualize_training_results(results):
"""
Plots the loss and accuracy for the training and testing data
"""
history = results.history
plt.figure(figsize=(12,4))
plt.plot(history['val_loss'])
... | en | 0.669057 | Plots the loss and accuracy for the training and testing data Splits the univariate time sequence Create a specified number of hidden layers for an RNN Optional: Adds regularization option, dropout layer to prevent potential overfitting if necessary # Creating the specified number of hidden layers with the specifie... | 3.455376 | 3 |
apex/contrib/multihead_attn/self_multihead_attn_func.py | Muflhi01/apex | 6,523 | 7148 | import torch
import torch.nn.functional as F
class SelfAttnFunc(torch.autograd.Function):
@staticmethod
def forward(
ctx,
use_time_mask,
is_training,
heads,
scale,
inputs,
input_weights,
output_weights,
input_biases,
output_biases... | import torch
import torch.nn.functional as F
class SelfAttnFunc(torch.autograd.Function):
@staticmethod
def forward(
ctx,
use_time_mask,
is_training,
heads,
scale,
inputs,
input_weights,
output_weights,
input_biases,
output_biases... | en | 0.680448 | # Input Linear GEMM # input1: (activations) [seql_q, seqs, embed_dim(1024)] # input2: (weights) [embed_dim*3 (3072), embed_dim (1024)] (transpose [0,1]) # output: [seql_q, seqs, embed_dim*3] # GEMM: ( (seql_q*seqs) x embed_dim ) x ( embed_dim x embed_dim*3 ) = (seql_q*seqs x embed_dim*3) # Slice out q... | 2.242805 | 2 |
api/app/reviews/models.py | NikolaSiplakova/Baobab | 0 | 7149 | <reponame>NikolaSiplakova/Baobab<filename>api/app/reviews/models.py
from datetime import datetime
from app import db
from app.utils import misc
class ReviewForm(db.Model):
id = db.Column(db.Integer(), primary_key=True)
application_form_id = db.Column(db.Integer(), db.ForeignKey('application_form.id'), nu... | from datetime import datetime
from app import db
from app.utils import misc
class ReviewForm(db.Model):
id = db.Column(db.Integer(), primary_key=True)
application_form_id = db.Column(db.Integer(), db.ForeignKey('application_form.id'), nullable=False)
is_open = db.Column(db.Boolean(), nullable=False)... | none | 1 | 2.497741 | 2 | |
speednet/vae/ConvVae.py | Abhranta/speednet | 1 | 7150 | <filename>speednet/vae/ConvVae.py
import torch.nn as nn
import torch
from utils import Flatten , Unflatten , weights_init , down_conv , up_conv
class Net(nn.Module):
def __init__(self , num_layers , img_dim , in_chan , act_func , latent_vector_size):
super(Net , self).__init__()
assert act... | <filename>speednet/vae/ConvVae.py
import torch.nn as nn
import torch
from utils import Flatten , Unflatten , weights_init , down_conv , up_conv
class Net(nn.Module):
def __init__(self , num_layers , img_dim , in_chan , act_func , latent_vector_size):
super(Net , self).__init__()
assert act... | none | 1 | 2.536498 | 3 | |
nelpy/utils.py | IsaacBusaleh/nelpy | 1 | 7151 | """This module contains helper functions and utilities for nelpy."""
__all__ = ['spatial_information',
'frange',
'swap_cols',
'swap_rows',
'pairwise',
'is_sorted',
'linear_merge',
'PrettyDuration',
'ddt_asa',
'get_contig... | """This module contains helper functions and utilities for nelpy."""
__all__ = ['spatial_information',
'frange',
'swap_cols',
'swap_rows',
'pairwise',
'is_sorted',
'linear_merge',
'PrettyDuration',
'ddt_asa',
'get_contig... | en | 0.773657 | This module contains helper functions and utilities for nelpy. #import gaussian_filter1d, gaussian_filter # so that core.RegularlySampledAnalogSignalArray is exposed # so that auxiliary.TuningCurve1D is epxosed # def sub2ind(array_shape, rows, cols): # ind = rows*array_shape[1] + cols # ind[ind < 0] = -1 # ... | 2.341217 | 2 |
python/paddle/fluid/contrib/slim/quantization/imperative/qat.py | logan-siyao-peng/Paddle | 0 | 7152 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | en | 0.779417 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app... | 1.532582 | 2 |
sc/northwind.py | elliotgunn/DS-Unit-3-Sprint-2-SQL-and-Databases | 0 | 7153 | <filename>sc/northwind.py
import pandas as pd
import sqlite3
from pandas import DataFrame
n_conn = sqlite3.connect('northwind_small.sqlite3')
n_curs = n_conn.cursor()
# What are the ten most expensive items (per unit price) in the database?
query = """
SELECT ProductName, UnitPrice
FROM Product
ORDER BY UnitPrice D... | <filename>sc/northwind.py
import pandas as pd
import sqlite3
from pandas import DataFrame
n_conn = sqlite3.connect('northwind_small.sqlite3')
n_curs = n_conn.cursor()
# What are the ten most expensive items (per unit price) in the database?
query = """
SELECT ProductName, UnitPrice
FROM Product
ORDER BY UnitPrice D... | en | 0.805081 | # What are the ten most expensive items (per unit price) in the database? SELECT ProductName, UnitPrice FROM Product ORDER BY UnitPrice DESC LIMIT 10 # What is the average age of an employee at the time of their hiring? (Hint: a # lot of arithmetic works with dates.) SELECT AVG(HireDate-BirthDate) FROM Employee # answe... | 4.045266 | 4 |
tests/test_app/library/loans/admin.py | Pijuli/django-jazzmin | 972 | 7154 | <gh_stars>100-1000
from django.contrib import admin
from django.urls import path
from .models import BookLoan, Library
from .views import CustomView
class BookLoanInline(admin.StackedInline):
model = BookLoan
extra = 1
readonly_fields = ("id", "duration")
fields = (
"book",
"imprint",... | from django.contrib import admin
from django.urls import path
from .models import BookLoan, Library
from .views import CustomView
class BookLoanInline(admin.StackedInline):
model = BookLoan
extra = 1
readonly_fields = ("id", "duration")
fields = (
"book",
"imprint",
"status",
... | en | 0.875827 | Add in a custom view to demonstrate = | 2.017611 | 2 |
lib/MergeMetabolicAnnotations/utils/CompareAnnotationsUtil.py | jeffkimbrel/MergeMetabolicAnnotations | 1 | 7155 | <reponame>jeffkimbrel/MergeMetabolicAnnotations<filename>lib/MergeMetabolicAnnotations/utils/CompareAnnotationsUtil.py<gh_stars>1-10
import os
import datetime
import logging
import json
import uuid
from installed_clients.WorkspaceClient import Workspace as Workspace
from installed_clients.KBaseReportClient import KBas... | import os
import datetime
import logging
import json
import uuid
from installed_clients.WorkspaceClient import Workspace as Workspace
from installed_clients.KBaseReportClient import KBaseReport
from installed_clients.annotation_ontology_apiServiceClient import annotation_ontology_api
import MergeMetabolicAnnotations.... | en | 0.742302 | # make reports # finalize html reports | 2.046759 | 2 |
models/__init__.py | TvSeriesFans/CineMonster | 15 | 7156 | from models.Model import Player, Group, Session, engine
| from models.Model import Player, Group, Session, engine
| none | 1 | 1.059391 | 1 | |
src/backend/tests/test_game/test_models.py | ToJestKrzysio/TheJungleGame | 0 | 7157 | <filename>src/backend/tests/test_game/test_models.py
from unittest.mock import Mock, patch
import numpy as np
from game.models import ValuePolicyModel
def test_predict():
mask = np.zeros((9, 7, 8), dtype=bool)
mask[1, 2, 3] = 1
mask[6, 6, 6] = 1
tensor_mock = Mock()
policy_tensor = np.zeros((9... | <filename>src/backend/tests/test_game/test_models.py
from unittest.mock import Mock, patch
import numpy as np
from game.models import ValuePolicyModel
def test_predict():
mask = np.zeros((9, 7, 8), dtype=bool)
mask[1, 2, 3] = 1
mask[6, 6, 6] = 1
tensor_mock = Mock()
policy_tensor = np.zeros((9... | none | 1 | 2.585912 | 3 | |
sina_spider/items.py | yanwen0614/Weibo | 0 | 7158 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy import Item, Field
class TweetsItem(Item):
# define the fields for your item here like:
Author = Field()
Title = Field()
Create_time = Fie... | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy import Item, Field
class TweetsItem(Item):
# define the fields for your item here like:
Author = Field()
Title = Field()
Create_time = Fie... | en | 0.60226 | # -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html # define the fields for your item here like: | 2.57713 | 3 |
emission/core/wrapper/client.py | Andrew-Tan/e-mission-server | 0 | 7159 | <filename>emission/core/wrapper/client.py
import json
import logging
import dateutil.parser
from datetime import datetime
# Our imports
from emission.core.get_database import get_profile_db, get_client_db, get_pending_signup_db
import emission.clients.common
class Client:
def __init__(self, clientName):
# TODO:... | <filename>emission/core/wrapper/client.py
import json
import logging
import dateutil.parser
from datetime import datetime
# Our imports
from emission.core.get_database import get_profile_db, get_client_db, get_pending_signup_db
import emission.clients.common
class Client:
def __init__(self, clientName):
# TODO:... | en | 0.911158 | # Our imports # TODO: write background process to ensure that there is only one client with each name # Maybe clean up unused clients? # clientJSON can be None if we are creating an entry for the first time # Avoid Attribute error while trying to determine whether the client is active # Do eagerly or lazily? Can also d... | 2.298099 | 2 |
setup.py | karianjahi/advent_of_code | 0 | 7160 | <filename>setup.py
import setuptools
setuptools.setup(name='advent_of_code') | <filename>setup.py
import setuptools
setuptools.setup(name='advent_of_code') | none | 1 | 0.796777 | 1 | |
src/csvutils.py | imco/nmx | 0 | 7161 | <gh_stars>0
def escapeQuotes(string):
return string.replace('"','""');
| def escapeQuotes(string):
return string.replace('"','""'); | none | 1 | 2.0495 | 2 | |
test/sanity_import_vpp_papi.py | amithbraj/vpp | 751 | 7162 | #!/usr/bin/env python3
""" sanity check script """
import vpp_papi
| #!/usr/bin/env python3
""" sanity check script """
import vpp_papi
| en | 0.181312 | #!/usr/bin/env python3 sanity check script | 1.135081 | 1 |
examples/labs/demo_dmtx.py | yarikoptic/nipy | 0 | 7163 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function # Python 2/3 compatibility
__doc__ = """
Examples of design matrices specification and and computation (event-related
design, FIR design, etc)
Re... | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function # Python 2/3 compatibility
__doc__ = """
Examples of design matrices specification and and computation (event-related
design, FIR design, etc)
Re... | en | 0.614167 | #!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # Python 2/3 compatibility Examples of design matrices specification and and computation (event-related design, FIR design, etc) Requires matplotlib Author : <NAME>: 2009-2010 # fram... | 2.454819 | 2 |
fbpcs/private_computation/test/service/test_private_computation.py | yelixu2/fbpcs | 0 | 7164 | <filename>fbpcs/private_computation/test/service/test_private_computation.py
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from collections import de... | <filename>fbpcs/private_computation/test/service/test_private_computation.py
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from collections import de... | en | 0.755698 | #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # TODO T94666166: libfb won't work in OSS # check instance_repository.create is called with the correct arguments # crea... | 1.635989 | 2 |
app.py | Eubule/Store-Manager-With-Datastructure | 0 | 7165 | from app import app
from app.database.db import Database
if __name__ == "__main__":
db = Database()
db.create_tables()
db.create_admin()
app.run(debug=True) | from app import app
from app.database.db import Database
if __name__ == "__main__":
db = Database()
db.create_tables()
db.create_admin()
app.run(debug=True) | none | 1 | 1.686835 | 2 | |
src/main.py | ryuichi1208/scraping-py | 2 | 7166 | # -*- coding: utf-8 -*-
# flake8: noqa
from flask import Flask
from flask_themes2 import Themes
import config
from util.auth import is_admin
from util.converter import RegexConverter
from util.csrf import generate_csrf_token
app = Flask(__name__.split('.')[0])
app.secret_key = config.SECRET_KEY
app.url_map.converter... | # -*- coding: utf-8 -*-
# flake8: noqa
from flask import Flask
from flask_themes2 import Themes
import config
from util.auth import is_admin
from util.converter import RegexConverter
from util.csrf import generate_csrf_token
app = Flask(__name__.split('.')[0])
app.secret_key = config.SECRET_KEY
app.url_map.converter... | en | 0.721679 | # -*- coding: utf-8 -*- # flake8: noqa # if debug property is present, let's use it | 1.859199 | 2 |
HoursSelect.py | Maxahoy/ClassVolumeSilencer | 0 | 7167 | <gh_stars>0
"""
This is how I'm gonna schedule hours
IDEA: import the format example file that I'm using and is saved in the same directory
"""
import csv
import pprint
from tkinter import *
from tkinter.filedialog import askopenfilename
import StringProcessing
def selectHoursFile():
Tk().withdraw() # we don... | """
This is how I'm gonna schedule hours
IDEA: import the format example file that I'm using and is saved in the same directory
"""
import csv
import pprint
from tkinter import *
from tkinter.filedialog import askopenfilename
import StringProcessing
def selectHoursFile():
Tk().withdraw() # we don't want a fu... | en | 0.654353 | This is how I'm gonna schedule hours IDEA: import the format example file that I'm using and is saved in the same directory # we don't want a full GUI, so keep the root window from appearing # show an "Open" dialog box and return the path to the selected file Receives a file location, opens the csv The format looks l... | 3.334569 | 3 |
src/bsmu/bone_age/models/dense_net/configs.py | IvanKosik/bone-age-models | 0 | 7168 | from pathlib import Path
from bsmu.bone_age.models import constants
IMAGE_DIR = Path('C:/MyDiskBackup/Projects/BoneAge/Data/SmallImages500_NoPads')
TRAIN_DATA_CSV_PATH = constants.TRAIN_DATA_CSV_PATH
VALID_DATA_CSV_PATH = constants.VALID_DATA_CSV_PATH
TEST_DATA_CSV_PATH = constants.TEST_DATA_CSV_PATH
BATC... | from pathlib import Path
from bsmu.bone_age.models import constants
IMAGE_DIR = Path('C:/MyDiskBackup/Projects/BoneAge/Data/SmallImages500_NoPads')
TRAIN_DATA_CSV_PATH = constants.TRAIN_DATA_CSV_PATH
VALID_DATA_CSV_PATH = constants.VALID_DATA_CSV_PATH
TEST_DATA_CSV_PATH = constants.TEST_DATA_CSV_PATH
BATC... | none | 1 | 1.765231 | 2 | |
projection.py | ogawan/nisa | 0 | 7169 | <gh_stars>0
from matplotlib import pyplot as plt
def nisa_projection(years=30, annual_deposit=80, initial_budget=100):
"""
This is a function to plot deposit of TSUMITATE NISA
Parameters:
---------------
years: integer
How many years are you going to continue?
annual_depoist: integer
Annua... | from matplotlib import pyplot as plt
def nisa_projection(years=30, annual_deposit=80, initial_budget=100):
"""
This is a function to plot deposit of TSUMITATE NISA
Parameters:
---------------
years: integer
How many years are you going to continue?
annual_depoist: integer
Annual deposit in... | en | 0.754846 | This is a function to plot deposit of TSUMITATE NISA Parameters: --------------- years: integer How many years are you going to continue? annual_depoist: integer Annual deposit into the NISA account. initial_budget: integer The initial budget. Returns: -------------- matplot... | 3.807096 | 4 |
indico/modules/oauth/models/applications.py | yamiacat/indico | 0 | 7170 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from uuid import uuid4
from sqlalchemy.dialects.postgresql import ARRAY, UUID
from sqlalchemy.ext.declara... | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from uuid import uuid4
from sqlalchemy.dialects.postgresql import ARRAY, UUID
from sqlalchemy.ext.declara... | en | 0.824573 | # This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. OAuth applications registered in Indico. #: the unique id of the application #: human readable name #: huma... | 1.975348 | 2 |
PaddleNLP/unarchived/deep_attention_matching_net/utils/layers.py | FrancisLiang/models-1 | 3 | 7171 | <reponame>FrancisLiang/models-1
import paddle.fluid as fluid
def loss(x, y, clip_value=10.0):
"""Calculate the sigmoid cross entropy with logits for input(x).
Args:
x: Variable with shape with shape [batch, dim]
y: Input label
Returns:
loss: cross entropy
logits: predicti... | import paddle.fluid as fluid
def loss(x, y, clip_value=10.0):
"""Calculate the sigmoid cross entropy with logits for input(x).
Args:
x: Variable with shape with shape [batch, dim]
y: Input label
Returns:
loss: cross entropy
logits: prediction
"""
logits = fluid.l... | en | 0.689285 | Calculate the sigmoid cross entropy with logits for input(x). Args: x: Variable with shape with shape [batch, dim] y: Input label Returns: loss: cross entropy logits: prediction Position-wise Feed-Forward Network Dot product layer. Args: query: a tensor with shap... | 2.699589 | 3 |
plugin.video.saltsrd.lite/js2py/translators/jsregexps.py | TheWardoctor/wardoctors-repo | 1 | 7172 | <filename>plugin.video.saltsrd.lite/js2py/translators/jsregexps.py
from salts_lib.pyjsparser.pyjsparserdata import *
REGEXP_SPECIAL_SINGLE = {'\\', '^', '$', '*', '+', '?', '.'}
NOT_PATTERN_CHARS = {'^', '$', '\\', '.', '*', '+', '?', '(', ')', '[', ']', '|'} # what about '{', '}', ???
CHAR_CLASS_ESCAPE = {'d', '... | <filename>plugin.video.saltsrd.lite/js2py/translators/jsregexps.py
from salts_lib.pyjsparser.pyjsparserdata import *
REGEXP_SPECIAL_SINGLE = {'\\', '^', '$', '*', '+', '?', '.'}
NOT_PATTERN_CHARS = {'^', '$', '\\', '.', '*', '+', '?', '(', ')', '[', ']', '|'} # what about '{', '}', ???
CHAR_CLASS_ESCAPE = {'d', '... | en | 0.486568 | # what about '{', '}', ??? Perform sctring escape - for regexp literals # quantifier will go inside atom! # try matching otherwise return None and restore the state # if no minimal number of digs provided then return no quantifier # scan char limit if provided # must be valid! | 2.364583 | 2 |
connectomics/model/block/squeeze_excitation.py | yixinliao/pytorch_connectomics | 1 | 7173 | import torch.nn as nn
from .basic import *
class squeeze_excitation_2d(nn.Module):
"""Squeeze-and-Excitation Block 2D
Args:
channel (int): number of input channels.
channel_reduction (int): channel squeezing factor.
spatial_reduction (int): pooling factor for x,y axes.
"""
def ... | import torch.nn as nn
from .basic import *
class squeeze_excitation_2d(nn.Module):
"""Squeeze-and-Excitation Block 2D
Args:
channel (int): number of input channels.
channel_reduction (int): channel squeezing factor.
spatial_reduction (int): pooling factor for x,y axes.
"""
def ... | en | 0.618703 | Squeeze-and-Excitation Block 2D Args: channel (int): number of input channels. channel_reduction (int): channel squeezing factor. spatial_reduction (int): pooling factor for x,y axes. Squeeze-and-Excitation Block 3D Args: channel (int): number of input channels. channel... | 2.714318 | 3 |
duckdown/handlers/site_handler.py | blueshed/duckdown | 0 | 7174 | <reponame>blueshed/duckdown
# pylint: disable=W0201, E1101
""" handle request for markdown pages """
import logging
import os
import importlib
from tornado.web import RequestHandler, HTTPError
from tornado.escape import url_escape
from ..utils.converter_mixin import ConverterMixin
from .access_control import UserMixin
... | # pylint: disable=W0201, E1101
""" handle request for markdown pages """
import logging
import os
import importlib
from tornado.web import RequestHandler, HTTPError
from tornado.escape import url_escape
from ..utils.converter_mixin import ConverterMixin
from .access_control import UserMixin
from ..utils.nav import nav
... | en | 0.342826 | # pylint: disable=W0201, E1101 handle request for markdown pages # pylint: disable=W0223 inline transform request for markdown pages setup init properties if we have one, us it determin if toc is empty return markdown meta value return markdown meta value set the handler site_nav attribute load nav section if it exist ... | 2.380397 | 2 |
Problemset/binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.py | KivenCkl/LeetCode | 7 | 7175 |
# @Title: 从二叉搜索树到更大和树 (Binary Search Tree to Greater Sum Tree)
# @Author: KivenC
# @Date: 2019-05-15 19:52:08
# @Runtime: 48 ms
# @Memory: 13 MB
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solu... |
# @Title: 从二叉搜索树到更大和树 (Binary Search Tree to Greater Sum Tree)
# @Author: KivenC
# @Date: 2019-05-15 19:52:08
# @Runtime: 48 ms
# @Memory: 13 MB
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solu... | en | 0.527201 | # @Title: 从二叉搜索树到更大和树 (Binary Search Tree to Greater Sum Tree) # @Author: KivenC # @Date: 2019-05-15 19:52:08 # @Runtime: 48 ms # @Memory: 13 MB # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None | 3.388637 | 3 |
vine/clone.py | robinson96/GRAPE | 4 | 7176 | import os
import option
import utility
import grapeMenu
import grapeGit as git
import grapeConfig
class Clone(option.Option):
""" grape-clone
Clones a git repo and configures it for use with git.
Usage: grape-clone <url> <path> [--recursive] [--allNested]
Arguments:
<url> The URL of th... | import os
import option
import utility
import grapeMenu
import grapeGit as git
import grapeConfig
class Clone(option.Option):
""" grape-clone
Clones a git repo and configures it for use with git.
Usage: grape-clone <url> <path> [--recursive] [--allNested]
Arguments:
<url> The URL of th... | en | 0.557869 | grape-clone Clones a git repo and configures it for use with git. Usage: grape-clone <url> <path> [--recursive] [--allNested] Arguments: <url> The URL of the remote repository <path> The directory where you want to clone the repo to. Options: --recursive Recursive... | 2.99747 | 3 |
neo/test/iotest/test_nixio.py | pearsonlab/python-neo | 0 | 7177 | # -*- coding: utf-8 -*-
# Copyright (c) 2016, German Neuroinformatics Node (G-Node)
# <NAME> <<EMAIL>>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of t... | # -*- coding: utf-8 -*-
# Copyright (c) 2016, German Neuroinformatics Node (G-Node)
# <NAME> <<EMAIL>>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of t... | en | 0.744932 | # -*- coding: utf-8 -*- # Copyright (c) 2016, German Neuroinformatics Node (G-Node) # <NAME> <<EMAIL>> # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted under the terms of the BSD License. See # LICENSE file in the root of t... | 2.017581 | 2 |
lib/taudataNlpTm.py | taudata-indonesia/elearning | 3 | 7178 | <reponame>taudata-indonesia/elearning
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 28 11:25:43 2019
@author: <NAME>
<EMAIL>
https://tau-data.id
~~Perjanjian Penggunaan Materi & Codes (PPMC) - License:~~
* Modul Python dan gambar-gambar (images) yang digunakan adalah milik dari berbagai sumber sebagaimana yan... | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 28 11:25:43 2019
@author: <NAME>
<EMAIL>
https://tau-data.id
~~Perjanjian Penggunaan Materi & Codes (PPMC) - License:~~
* Modul Python dan gambar-gambar (images) yang digunakan adalah milik dari berbagai sumber sebagaimana yang telah dicantumkan dalam masing-masin... | id | 0.613824 | # -*- coding: utf-8 -*- Created on Wed Mar 28 11:25:43 2019
@author: <NAME>
<EMAIL>
https://tau-data.id
~~Perjanjian Penggunaan Materi & Codes (PPMC) - License:~~
* Modul Python dan gambar-gambar (images) yang digunakan adalah milik dari berbagai sumber sebagaimana yang telah dicantumkan dalam masing-masing lice... | 2.199862 | 2 |
reamber/base/MapSet.py | Eve-ning/reamber_base_py | 10 | 7179 | from __future__ import annotations
from copy import deepcopy
from dataclasses import dataclass, field
from typing import List, Iterator, TypeVar, Union, Any, Generic
import pandas as pd
from pandas.core.indexing import _LocIndexer
from reamber.base.Map import Map
from reamber.base.Property import stack_props
NoteLi... | from __future__ import annotations
from copy import deepcopy
from dataclasses import dataclass, field
from typing import List, Iterator, TypeVar, Union, Any, Generic
import pandas as pd
from pandas.core.indexing import _LocIndexer
from reamber.base.Map import Map
from reamber.base.Property import stack_props
NoteLi... | en | 0.919968 | # We want to index by type. # We want to index by slice/int/etc. Returns a deep copy of itself Describes the map's attributes as a short summary :param rounding: The decimal rounding :param unicode: Whether to attempt to get the non-unicode or unicode. \ Doesn't attempt to translate. Change... | 2.555017 | 3 |
src/poretitioner/utils/filtering.py | uwmisl/poretitioner | 2 | 7180 | """
=========
filtering.py
=========
This module provides more granular filtering for captures.
You can customize your own filters too.
"""
from __future__ import annotations
import re
from abc import ABC, ABCMeta, abstractmethod
from dataclasses import dataclass
from json import JSONEncoder
from pathlib import Posi... | """
=========
filtering.py
=========
This module provides more granular filtering for captures.
You can customize your own filters too.
"""
from __future__ import annotations
import re
from abc import ABC, ABCMeta, abstractmethod
from dataclasses import dataclass
from json import JSONEncoder
from pathlib import Posi... | en | 0.786555 | ========= filtering.py ========= This module provides more granular filtering for captures. You can customize your own filters too. # Unique identifier for a collection of filters (e.g. "ProfJeffsAwesomeFilters") # Unique identifier for an individual filter (e.g. "min_frac") A blueprint for how to construct a FilterPl... | 2.104379 | 2 |
Chapter 11/wrong_type.py | nescience8/starting-out-with-python-global-4th-edition | 35 | 7181 | <gh_stars>10-100
def main():
# Pass a string to show_mammal_info...
show_mammal_info('I am a string')
# The show_mammal_info function accepts an object
# as an argument, and calls its show_species
# and make_sound methods.
def show_mammal_info(creature):
creature.show_species()
creature.make_s... | def main():
# Pass a string to show_mammal_info...
show_mammal_info('I am a string')
# The show_mammal_info function accepts an object
# as an argument, and calls its show_species
# and make_sound methods.
def show_mammal_info(creature):
creature.show_species()
creature.make_sound()
# Call th... | en | 0.812835 | # Pass a string to show_mammal_info... # The show_mammal_info function accepts an object # as an argument, and calls its show_species # and make_sound methods. # Call the main function. | 3.305497 | 3 |
fase2-exercicios/cap2/lista-de-exercicios/RM94336_EX04.py | Leodf/FIAP | 0 | 7182 | <gh_stars>0
"""
4 – Um grande cliente seu sofreu um ataque hacker: o servidor foi sequestrado por um software malicioso, que criptografou todos os discos e pede a digitação de uma senha para a liberação da máquina. E é claro que os criminosos exigem um pagamento para informar a senha.
Ao analisar o código do programa ... | """
4 – Um grande cliente seu sofreu um ataque hacker: o servidor foi sequestrado por um software malicioso, que criptografou todos os discos e pede a digitação de uma senha para a liberação da máquina. E é claro que os criminosos exigem um pagamento para informar a senha.
Ao analisar o código do programa deles, porém... | pt | 0.983608 | 4 – Um grande cliente seu sofreu um ataque hacker: o servidor foi sequestrado por um software malicioso, que criptografou todos os discos e pede a digitação de uma senha para a liberação da máquina. E é claro que os criminosos exigem um pagamento para informar a senha. Ao analisar o código do programa deles, porém, vo... | 3.90815 | 4 |
dosagelib/helpers.py | yasen-m/dosage | 0 | 7183 | <reponame>yasen-m/dosage
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 <NAME> and <NAME>
# Copyright (C) 2012-2014 <NAME>
from .util import fetchUrl, getPageContent, getQueryParams
def queryNamer(paramName, usePageUrl=False):
"""Get name from URL query part."""
@classmethod
def _namer(cls, imageUr... | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 <NAME> and <NAME>
# Copyright (C) 2012-2014 <NAME>
from .util import fetchUrl, getPageContent, getQueryParams
def queryNamer(paramName, usePageUrl=False):
"""Get name from URL query part."""
@classmethod
def _namer(cls, imageUrl, pageUrl):
"""G... | en | 0.71142 | # -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 <NAME> and <NAME> # Copyright (C) 2012-2014 <NAME> Get name from URL query part. Get URL query part. Get name from regular expression. Get first regular expression group. Get start URL by "bouncing" back and forth one time. Get bounced start URL. Get start URL by i... | 2.458038 | 2 |
research/object_detection/data_decoders/tf_example_decoder_test.py | akshit-protonn/models | 18 | 7184 | <gh_stars>10-100
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | en | 0.479701 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 2.235444 | 2 |
counting_capitals.py | m10singh94/Python-programs | 0 | 7185 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 21 08:09:31 2020
@author: <NAME>
"""
def count_capitals(string):
count = 0
for ch in string:
if ord(ch) >= 65 and ord(ch) <= 90:
count += 1
return count
def remove_substring_everywhere(string, substring):
'''
Remove all occurrence... | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 21 08:09:31 2020
@author: <NAME>
"""
def count_capitals(string):
count = 0
for ch in string:
if ord(ch) >= 65 and ord(ch) <= 90:
count += 1
return count
def remove_substring_everywhere(string, substring):
'''
Remove all occurrence... | en | 0.793624 | # -*- coding: utf-8 -*- Created on Tue Apr 21 08:09:31 2020 @author: <NAME> Remove all occurrences of substring from string, and return the resulting string. Both arguments must be strings. # length of the substring | 3.921274 | 4 |
admit/at/GenerateSpectrum_AT.py | astroumd/admit | 4 | 7186 | """ .. _GenerateSpectrum-at-api:
**GenerateSpectrum_AT** --- Generates synthetic test spectra.
-------------------------------------------------------------
This module defines the GenerateSpectrum_AT class.
"""
from admit.AT import AT
import admit.util.bdp_types as bt
from admit.bdp.CubeSpectrum_BDP import ... | """ .. _GenerateSpectrum-at-api:
**GenerateSpectrum_AT** --- Generates synthetic test spectra.
-------------------------------------------------------------
This module defines the GenerateSpectrum_AT class.
"""
from admit.AT import AT
import admit.util.bdp_types as bt
from admit.bdp.CubeSpectrum_BDP import ... | en | 0.746999 | .. _GenerateSpectrum-at-api: **GenerateSpectrum_AT** --- Generates synthetic test spectra. ------------------------------------------------------------- This module defines the GenerateSpectrum_AT class. Define a synthetic CubeSpectrum for testing. This task is only intended to generate synthetic spectr... | 2.448842 | 2 |
lib/flows/general/discovery_test.py | nahidupa/grr | 1 | 7187 | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Tests for Interrogate."""
import socket
from grr.client import vfs
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import artifact_test
from grr.lib import client_index
from grr.lib import config_lib
from grr.lib import flags
fro... | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Tests for Interrogate."""
import socket
from grr.client import vfs
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import artifact_test
from grr.lib import client_index
from grr.lib import config_lib
from grr.lib import flags
fro... | en | 0.874808 | #!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- Tests for Interrogate. A test listener to receive new client discoveries. # For this test we just write the event as a class attribute. Test the interrogate flow. Check all user stores. # Check kb users Check old and new client config. Check that the index h... | 1.925808 | 2 |
practices/20210112/GraphicsView.py | liff-engineer/articles | 2 | 7188 | <reponame>liff-engineer/articles
import sys
from PySide2.QtWidgets import QGraphicsView, QGraphicsScene, QApplication
from PySide2.QtCore import *
from PySide2.QtGui import *
class GraphicsView(QGraphicsView):
def __init__(self, parent=None):
super().__init__(parent)
# 画布视图尺寸
self.w = 64... | import sys
from PySide2.QtWidgets import QGraphicsView, QGraphicsScene, QApplication
from PySide2.QtCore import *
from PySide2.QtGui import *
class GraphicsView(QGraphicsView):
def __init__(self, parent=None):
super().__init__(parent)
# 画布视图尺寸
self.w = 64000.0
self.h = 32000.0
... | zh | 0.925067 | # 画布视图尺寸 # 缩放相关 | 2.349942 | 2 |
armstrong/hatband/tests/_utils.py | joncotton/armstrong.hatband | 0 | 7189 | from armstrong.dev.tests.utils import ArmstrongTestCase
import random
def random_range():
# TODO: make sure this can only be generated once
return range(random.randint(1000, 2000))
class HatbandTestCase(ArmstrongTestCase):
pass
class HatbandTestMixin(object):
script_code = """
<script type="t... | from armstrong.dev.tests.utils import ArmstrongTestCase
import random
def random_range():
# TODO: make sure this can only be generated once
return range(random.randint(1000, 2000))
class HatbandTestCase(ArmstrongTestCase):
pass
class HatbandTestMixin(object):
script_code = """
<script type="t... | en | 0.543242 | # TODO: make sure this can only be generated once <script type="text/javascript" src="/static/ckeditor/ckeditor.js"></script> | 2.407747 | 2 |
tests/propositional/test_natural_deduction.py | ariroffe/logics | 12 | 7190 | import unittest
from logics.classes.propositional import Inference, Formula
from logics.classes.propositional.proof_theories import NaturalDeductionStep, NaturalDeductionRule
from logics.utils.parsers import classical_parser
from logics.instances.propositional.natural_deduction import classical_natural_deduction_syste... | import unittest
from logics.classes.propositional import Inference, Formula
from logics.classes.propositional.proof_theories import NaturalDeductionStep, NaturalDeductionRule
from logics.utils.parsers import classical_parser
from logics.instances.propositional.natural_deduction import classical_natural_deduction_syste... | en | 0.74266 | Test overriding of index and len methods in NaturalDeductionRule Test the method that tells if a step is a correct application of a rule # A correct derivation p; premise (p → q); premise q; E→; [1, 0]; [] p ∧ q; I∧; [0, 2]; [] # Check is application of the correct rule, and a differ... | 3.102818 | 3 |
src/trusted/validator_arm/dgen_decoder_output.py | cohortfsllc/cohort-cocl2-sandbox | 2,151 | 7191 | <filename>src/trusted/validator_arm/dgen_decoder_output.py
#!/usr/bin/python
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""
Responsible for generating the decoder based on parsed
table re... | <filename>src/trusted/validator_arm/dgen_decoder_output.py
#!/usr/bin/python
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""
Responsible for generating the decoder based on parsed
table re... | en | 0.686506 | #!/usr/bin/python # # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Responsible for generating the decoder based on parsed table representations. # This file generates the class decoder Decoder a... | 2.294665 | 2 |
compose/progress_stream.py | ilinum/compose | 1 | 7192 | from __future__ import absolute_import
from __future__ import unicode_literals
from compose import utils
class StreamOutputError(Exception):
pass
def stream_output(output, stream):
is_terminal = hasattr(stream, 'isatty') and stream.isatty()
stream = utils.get_output_stream(stream)
all_events = []
... | from __future__ import absolute_import
from __future__ import unicode_literals
from compose import utils
class StreamOutputError(Exception):
pass
def stream_output(output, stream):
is_terminal = hasattr(stream, 'isatty') and stream.isatty()
stream = utils.get_output_stream(stream)
all_events = []
... | en | 0.724837 | # if it's a progress event and we have a terminal, then display the progress bars # move cursor up `diff` rows # move cursor back down # erase current line | 2.380994 | 2 |
tests/test_db.py | beloglazov/openstack-neat | 34 | 7193 | # Copyright 2012 <NAME>
#
# 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, softw... | # Copyright 2012 <NAME>
#
# 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, softw... | en | 0.850766 | # Copyright 2012 <NAME> # # 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, softw... | 2.043107 | 2 |
libs/BIDS.py | GuillermoPerez32/EE2BIDS_backend | 0 | 7194 | import os
from bids_validator import BIDSValidator
def validate(bids_directory):
print('- Validate: init started.')
file_paths = []
result = []
validator = BIDSValidator()
for path, dirs, files in os.walk(bids_directory):
for filename in files:
if filename == '.bidsignore':
... | import os
from bids_validator import BIDSValidator
def validate(bids_directory):
print('- Validate: init started.')
file_paths = []
result = []
validator = BIDSValidator()
for path, dirs, files in os.walk(bids_directory):
for filename in files:
if filename == '.bidsignore':
... | en | 0.225719 | # print(validator.is_bids(temp[len(bids_directory):len(temp)])) | 2.785943 | 3 |
src/python/triangula/chassis.py | peterbrazil/brazil | 0 | 7195 | from math import cos, sin, degrees, radians, pi
from time import time
from euclid import Vector2, Point2
from numpy import array as np_array
from numpy.linalg import solve as np_solve
__author__ = 'tom'
def test():
chassis = HoloChassis(wheels=[
HoloChassis.OmniWheel(position=Point2(1, 0), angle=0, radi... | from math import cos, sin, degrees, radians, pi
from time import time
from euclid import Vector2, Point2
from numpy import array as np_array
from numpy.linalg import solve as np_solve
__author__ = 'tom'
def test():
chassis = HoloChassis(wheels=[
HoloChassis.OmniWheel(position=Point2(1, 0), angle=0, radi... | en | 0.855176 | Rotate a Point2 around another Point2 :param euclid.Point2 point: The point to rotate :param float angle: Angle in radians, clockwise rotation :param euclid.Point2 origin: Origin of the rotation, defaults to (0,0) if not specified :return: A new :class:`euclid.Point2` co... | 3.414082 | 3 |
libs/PureCloudPlatformClientV2/models/management_unit.py | rocketbot-cl/genesysCloud | 1 | 7196 | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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 applica... | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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 applica... | en | 0.730535 | # coding: utf-8 Copyright 2016 SmartBear Software 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 l... | 1.832103 | 2 |
harmony_tools/core/colors.py | a1fred/guitar_gammas | 1 | 7197 | COLOR_BLUE = '\033[0;34m'
COLOR_GREEN = '\033[0;32m'
COLOR_CYAN = '\033[0;36m'
COLOR_RED = '\033[0;31m'
COLOR_PURPLE = '\033[0;35m'
COLOR_BROWN = '\033[0;33m'
COLOR_YELLOW = '\033[1;33m'
COLOR_GRAY = '\033[1;30m'
COLOR_RESET = '\033[0m'
FG_COLORS = [
# COLOR_BLUE,
COLOR_GREEN,
# COLOR_CYAN,
# COLOR_R... | COLOR_BLUE = '\033[0;34m'
COLOR_GREEN = '\033[0;32m'
COLOR_CYAN = '\033[0;36m'
COLOR_RED = '\033[0;31m'
COLOR_PURPLE = '\033[0;35m'
COLOR_BROWN = '\033[0;33m'
COLOR_YELLOW = '\033[1;33m'
COLOR_GRAY = '\033[1;30m'
COLOR_RESET = '\033[0m'
FG_COLORS = [
# COLOR_BLUE,
COLOR_GREEN,
# COLOR_CYAN,
# COLOR_R... | en | 0.457127 | # COLOR_BLUE, # COLOR_CYAN, # COLOR_RED, # COLOR_PURPLE, # COLOR_BROWN, # COLOR_YELLOW, | 2.531961 | 3 |
Common_Questions/TextBookQuestions/PythonCrashCourse/Chapter_8/8_5.py | tegamax/ProjectCode | 0 | 7198 | <reponame>tegamax/ProjectCode
'''
8-5. Cities: Write a function called describe_city() that accepts the name of a city and its country.
The function should print a simple sentence, such as Reykjavik is in Iceland. Give the parameter for the country a default value.
Call your function for three different cities, at le... | '''
8-5. Cities: Write a function called describe_city() that accepts the name of a city and its country.
The function should print a simple sentence, such as Reykjavik is in Iceland. Give the parameter for the country a default value.
Call your function for three different cities, at least one of which is not in the... | en | 0.892589 | 8-5. Cities: Write a function called describe_city() that accepts the name of a city and its country. The function should print a simple sentence, such as Reykjavik is in Iceland. Give the parameter for the country a default value. Call your function for three different cities, at least one of which is not in the def... | 4.561321 | 5 |
tests/test_geometry_loader.py | trnielsen/nexus-constructor | 0 | 7199 | <filename>tests/test_geometry_loader.py<gh_stars>0
from nexus_constructor.geometry import OFFGeometryNoNexus
from nexus_constructor.geometry.geometry_loader import load_geometry_from_file_object
from nexus_constructor.off_renderer import repeat_shape_over_positions
from PySide2.QtGui import QVector3D
from io import Str... | <filename>tests/test_geometry_loader.py<gh_stars>0
from nexus_constructor.geometry import OFFGeometryNoNexus
from nexus_constructor.geometry.geometry_loader import load_geometry_from_file_object
from nexus_constructor.off_renderer import repeat_shape_over_positions
from PySide2.QtGui import QVector3D
from io import Str... | en | 0.421981 | # faces on a cube with a right hand winding order # bottom # left # front # right # rear # top solid vcg facet normal -1.000000e+00 0.000000e+00 0.000000e+00 outer loop vertex 0.000000e+00 3.000000e+01 0.000000e+00 vertex 0.000000e+00 0.000000e+00 3.000000e+01 vertex ... | 2.262449 | 2 |